|
Post by boyangli on Aug 18, 2015 7:01:55 GMT
We usually use the SAFS keyword like WaitForGUI to judge if the component appears and ready for the next steps. I am testing a html5 application, and play with something like TabControl. There is a search field in Tab1, and some other components in Tab2. When Tab2 is selected, using WaitForGUI for the search field in Tab1, it still tells the component is found although it is not visible on screen. I checked the the property "visible" in Style, but its value is always "". Currently I tried to check the properties like "clientHeight" and "clientWidth". When the component is invisible, these properties value change to "0". Do you have any experience on this?
|
|
lihua
New Member
Posts: 8
|
Post by lihua on Aug 20, 2015 6:13:29 GMT
Thank you very much for sharing this.
|
|
|
Post by sascanagl on Aug 21, 2015 13:53:19 GMT
I have reviewed our Search algorithms as used by the WaitForGUI Driver Command and do recognize that we do NOT test for visibility of the component in those algorithms--just that the component is found to be valid. Doing a WaitForPropertyValue or WaitForPropertyValueGone might be better suited if you know what the property value is going to be.
A combination of WaitForGui and WaitForPropertyValue might work for you. Or, WaitForGUI and then a loop where you get a property value and make sure it is greater than or less than some value with the OnGreaterThan or OnLessThan Driver Commands.
It would be good to know what WDLibrary.isDisplayed(WebElement) or WDLibrary.isVisible(WebElement) give you for such a component. These might need to be modified to give us a more correct response for this situation.
|
|
|
Post by boyangli on Aug 24, 2015 3:04:11 GMT
I have reviewed our Search algorithms as used by the WaitForGUI Driver Command and do recognize that we do NOT test for visibility of the component in those algorithms--just that the component is found to be valid. Doing a WaitForPropertyValue or WaitForPropertyValueGone might be better suited if you know what the property value is going to be. A combination of WaitForGui and WaitForPropertyValue might work for you. Or, WaitForGUI and then a loop where you get a property value and make sure it is greater than or less than some value with the OnGreaterThan or OnLessThan Driver Commands. It would be good to know what WDLibrary.isDisplayed(WebElement) or WDLibrary.isVisible(WebElement) give you for such a component. These might need to be modified to give us a more correct response for this situation. Thank you for the information, Carl. Now I use some combination of WaitForGUI and other APIs to judge this as you mentioned. And for my case, WDLibrary.isDisplayed returns 'false', and WDLibrary.isVisible returns 'true', looks like WDLibrary.isDisplayed gives the expected result.
|
|
|
Post by leiwang on Aug 27, 2015 11:59:43 GMT
Concerning WDLibrary.isDisplayed() and WDLibrary.isVisible(): WDLibrary.isDisplayed() will simply call WebElement.isDisplayed() to get the result; but WDLibrary.isVisible() will also check the value of property 'visibility'.
|
|