0

How to check and wait until a specific attribute of an selenideelement contains a string through Selenide api. Say if I want to wait until "href" attribute contains the word "Test"

2 Answers2

0
element.shouldHave(attribute("href", "Test"));

In most cases, you don't need #waitUntil or #waitWhile methods because all should- methods wait too. You need to use #waitUntil or #waitWhile methods only if you need another timeout.

For instance:

element.waitUntil(attribute("href", "Test"), 10000, 1000);
  • where 10000 is timeoutMilliseconds and 1000 is pollingIntervalMilliseconds

Reference: SelenideElement

TheChosenOne
  • 121
  • 1
  • 3
-1

Selenide element = $("your_locator") ; element.waitUntil(have(cssValue("href", "test"), your_time) ;