Selenium IDE - 如何在测试用例中检查元素是否具有某些 [style] 属性?
Selenium IDE - How to check whether element has some [style] attribute or not in testcase?
因此,我的测试具有以下命令目标值:
store attribute
id=loadGameButton
*visible*
Trying to find id=loadGameButton... Failed:16:58:58
Implicit Wait timed out after 30000ms
我试过了How to check if a style has been applied in Selenium IDE
还有这个Selenium IDE cannot find ID
store attribute
css=#loadGameButton@style
*inline*
store attribute
css=[id='loadGameButton']
*inline*
但也不起作用:它总是 returns 正常,但与我要检查的内容不符。
https://github.com/Areso/1255-burgomaster/tree/master/selenium-ide
store attribute 不检查属性值,它只保存所选元素的值。要检查它,您应该使用 assert
或 verify
命令。
store attribute | css=<path_to_element>@style | tmp
assert | tmp | <expected_style_value>
path_to_element - css 元素选择器
例如可以用'width:100%'代替expected_style_value
因此,我的测试具有以下命令目标值:
store attribute
id=loadGameButton
*visible*
Trying to find id=loadGameButton... Failed:16:58:58
Implicit Wait timed out after 30000ms
我试过了How to check if a style has been applied in Selenium IDE 还有这个Selenium IDE cannot find ID
store attribute
css=#loadGameButton@style
*inline*
store attribute
css=[id='loadGameButton']
*inline*
但也不起作用:它总是 returns 正常,但与我要检查的内容不符。
https://github.com/Areso/1255-burgomaster/tree/master/selenium-ide
store attribute 不检查属性值,它只保存所选元素的值。要检查它,您应该使用 assert
或 verify
命令。
store attribute | css=<path_to_element>@style | tmp
assert | tmp | <expected_style_value>
path_to_element - css 元素选择器
例如可以用'width:100%'代替expected_style_value