admin管理员组文章数量:1335861
I have the following code:
<div class="ui-multiselect-menu ui-widget ui-widget-content ui-corner-all ui-multiselect-single" style="width: 192px; top: 172px; left: 299.9px; display: none;">
how can i use verifyAttribute or any other mand to validate that the style is display: none;
?
the xpath that I have is /html/body/div[3]
I have the following code:
<div class="ui-multiselect-menu ui-widget ui-widget-content ui-corner-all ui-multiselect-single" style="width: 192px; top: 172px; left: 299.9px; display: none;">
how can i use verifyAttribute or any other mand to validate that the style is display: none;
?
the xpath that I have is /html/body/div[3]
3 Answers
Reset to default 2You have to match your style attribute with xpath contains, for example
//*[contains(@style,'display: none')]
this means any element which has display: none. you can further refine it like //div[contains(@style,'display: none')]
Better late then never...
Command: assertAttribute
Target: css=#div_id@style
Value: display: none
You can store the attribute value and verify it.
For example, to check style attribute on span in td:
1. Store attribute value in variable:
Command: store atribute
Target: css=tr:nth-child(2) > td:nth-child(3) > span@style
(you can also use xpath here)
Value: estilo
2. Check it with echo (for spaces, colons...):
Command: echo
Target: ${estilo}
3. And verify or assert it:
Command: assert
Target: estilo
Value: color: rgb(111, 235, 10);
本文标签: javascripthow to verify style attribute in Selenium IDEStack Overflow
版权声明:本文标题:javascript - how to verify style attribute in Selenium IDE - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742397461a2467212.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论