0
       Profile User
        ${profile_user}     ${profile_domain}=      Split String       ${username}    separator=@
        ${profile_user}=    Replace String          ${profile_user}    -              ${SPACE}
        ${profile_user}=    Convert To Uppercase    ${profile_user}
        [Return]            ${profile_user}
    
    # Both are equal , but still return None    
    Validate Owner field
        [Arguments]            ${owner}
        ${text}=               Convert To Uppercase      ${owner}
        ${profile_user}=       Profile User
        log                    ${text}
        ${status}=             should contain      ${profile_user}      ${text}
        [Return]               ${status}
    
    # We can validate awp text
    Validate softwarebundle field
        [Arguments]            ${softwarebundle}      ${bundle_id}
        ${bundle_id}=          Convert To Uppercase      ${bundle_id}
        ${bundle_id}=          Replace String            ${bundle_id}    -              ${SPACE}
        ${status}=             should contain       ${softwarebundle}         ${bundle_id}
        [Return]               ${status}
    
    **# I want to validate weather complete date is matching with the same format  using current date**
    Validate Create time
        [Arguments]               ${expdate}
        ${UI_Creation_time}=      Set Variable             ${text}
        ${CurrentDate} =    Get Current Date    result_format=%m/%d/%Y
        Log    ${CurrentDate}
        ${status}=                should contain           ${text}      ${CurrentDate}
        [Return]                  ${status}
        
        
        
****Data:
${username}=    UAT APP USER
${owner}=       UAT APP USER
${softwarebundle}=          awp 9.4 se      
${bundle_id}=               awp
${expdate}=    06/30/2020 6.40PM****
        
    

**使用上述数据,我们应该将每个功能的状态设为 True,然后只有我可以继续执行其他功能。

对于第二个函数,我试图在框架中使用 should be equal 关键字验证完整数据,但它返回 None 对于我正在使用的第三个函数应该包含关键字。对于第一个变量,我们将数据获取为“awp ss wrd”,在这里我想验证“aws”是否可用,但条件仍然失败第四个,我想使用“06/30/2020 6.40 PM”格式验证日期',在这里我尝试只验证没有时间的日期,但它仍然返回无。

4

1 回答 1

1

要获取变量 true false 的返回状态,请尝试使用此关键字Run Keyword And Return Status

${status}=      Run Keyword And Return Status   should contain      ${profile_user}      ${text}

预期的结果将是 True 和 False。 文档

于 2020-07-01T07:37:47.400 回答