1

So, my test has the following command-target-value:

store attribute
id=loadGameButton
*visible*

Trying to find id=loadGameButton... Failed:16:58:58

Implicit Wait timed out after 30000ms

I tried this How to check if a style has been applied in Selenium IDE And this Selenium IDE cannot find ID

store attribute
css=#loadGameButton@style
*inline*
store attribute
css=[id='loadGameButton']
*inline*

but doesn't work either: it always returns OK without correspondence to what I am trying to check.

https://github.com/Areso/1255-burgomaster/tree/master/selenium-ide

Community
  • 1
  • 1
Areso
  • 67
  • 1
  • 2
  • 11

1 Answers1

2

store attribute doesn't check value of attribute, it just save the value of selected element. To check it, you should use assert or verify commands.

store attribute | css=<path_to_element>@style | tmp
assert | tmp | <expected_style_value>

path_to_element - css selector of element

For example, you can use 'width:100%' to replace expected_style_value

  • Wow, it seems now I got the idea. Could you describe, how could I check partial match? `assert on tmp with value top: 310px` Failed:16:23:09` `Actual value 'top: 310px; left: 20px; visibility: visible;' did not match 'top: 310px'`. I tried to add asterisk (star) before and after the value, doesn't work for me. – Areso Oct 08 '19 at 11:24
  • I think it is not possible to check with just one assert command. Firstly you should use `execute script` in which you save result of comparison *tmp* and *top: 310px* in new variable(or you can use the same variable) and then use `assert | tmp | true` which will check result of comparison. – Roslyakova Maria Oct 08 '19 at 14:13
  • `executeScript on n = tmp.indexOf("310px");` Failed: 19:55:18 tmp is not defined – Areso Oct 08 '19 at 14:57
  • 1
    Here I use regexp to find style and save result in tmp variable `executeScript | return /310px/.test(${tmp})| tmp` – Roslyakova Maria Oct 08 '19 at 15:11