英文:
statements under if are not getting executed in robotframework(pythonselenium)
问题
"${elementvisibity}= Run Keyword And Return Status Element Should Be Enabled ${loc_ddlRatePlan}
IF ${elementvisibity} == 'True'
Wait Until Element Is Enabled ${loc_ddlRatePlan}
variable status is been returned as true but wait statement inside if is not getting executed
should execute statements under if"
英文:
${elementvisibity}= Run Keyword And Return Status Element Should Be Enabled ${loc_ddlRatePlan}
IF ${elementvisibity} == 'True'
Wait Until Element Is Enabled ${loc_ddlRatePlan}
variable status is been returned as true but wait statement inside if is not getting executed
should execute statements under if
答案1
得分: 1
Run Keyword And Return Status
关键字返回一个布尔值 True 或 False。您的代码针对字符串 True 或 False 进行检查。以下是正确的方法:
Element Visibility
${elementvisibity}= Run Keyword And Return Status No Operation
${valueType}= Evaluate type(${elementvisibity})
Log ${valueType}
IF ${elementvisibity} == ${TRUE}
Log True
END
英文:
Run Keyword And Return Status
keyword returns a boolean True or False. Your code makes a check against the string True or False. Here is the correct way:
Element Visibility
${elementvisibity}= Run Keyword And Return Status No Operation
${valueType}= Evaluate type(${elementvisibity})
Log ${valueType}
IF ${elementvisibity} == ${TRUE}
Log True
END
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论