Monday, March 17, 2014

UFT - Wait until Loading Icon is no longer displayed

I had something like this:

Search for something -> loading icon displayed until search is done -> results are displayed.
Here is the solution using XPath:

While Browser("Browser_Local").WebElement("xpath:=//div[contains(@class,'hitsArea')]/descendant::td[contains(@class,'cell-loadingIcon') and not(contains(@style,'display: none'))]").Exist = False
    wait 2
Wend

- It looks for the div, that contains a class named "hitsArea"
- finds between its descendants, one that contacins a class named "cell-loadingIcon"
- and it is not hidden: not(contains(@style,'display: none'))


No comments:

Post a Comment