5

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 command to validate that the style is display: none; ? the xpath that I have is /html/body/div[3]

4

3 回答 3

2

迟到总比不...

命令:assertAttribute
目标:css=#div_id@style
值:显示:无

于 2014-03-19T18:15:55.420 回答
1

您必须将您的样式属性与 xpath contains 相匹配,例如 //*[contains(@style,'display: none')]这意味着任何具有 display: none 的元素。你可以进一步细化它//div[contains(@style,'display: none')]

于 2013-05-21T10:06:41.627 回答
0

您可以存储属性值并对其进行验证。

例如,要检查 td 中 span 的样式属性:

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);
于 2021-08-06T09:09:43.333 回答