Adding "WaitUntilNotDisplayed" #99
Replies: 5 comments 8 replies
-
@GHRyunosuke, I think this a worthwhile addition. One question I have for you and the community... Currently we have WaitUntilReady, which waits until the element is displayed (interactable). So should we:
Anyone have a preference on how to resolve? |
Beta Was this translation helpful? Give feedback.
-
@GHRyunosuke, the reason why IsPresent is structured differently than IsDisplayed is that an element object can only be valid if it is present. Or in other words, if you have a valid element object, you already know it's present. IsPresent is just a wrapper around FindElement that returns true if the element was found, hence the reason why it is structured similarly to FindElement. Whereas the IsDisplayed method applies to an element object that you already know is present. Does that make sense? |
Beta Was this translation helpful? Give feedback.
-
👍Ok, I'll add your WaitUntilNotDisplayed method this week. |
Beta Was this translation helpful? Give feedback.
-
I'm in favor of having the full set of WaitUntil and WaitUntilNot options, including WaitUntilNotPresent, even if there are relating Is or IsNot functions with the "implicit wait" parameter. I'd also suggest centralizing the logic of the four WaitUntil and WaitUntilNot options in a new private "waitUntil" function with an argument like "UntilWhat" (string or enum), since almost all the code is the same. |
Beta Was this translation helpful? Give feedback.
-
@GHRyunosuke - Added WaitUntilNotDisplayed and renamed WaitUntilReady to WaitUntilDisplayed in version 5.0. @6DiegoDiego9 - There are only three WaitUntil's - WaitUntilDisplayed, WaitUntilNotDisplayed, and WaitUntilNotPresent. There isn't a WaitUntilPresent because that functionality is handled by the Find* methods + setting implicit max wait. We certainly can add a WaitUntilPresent, but it would be somewhat functionally redundant. As far as refactoring the WaitUntil's to reduce duplicate code, I did incorporate your suggestion to replace SleepWinAPI/DoEvents with your enhanced sleep function. However, because WaitUntilNotPresent has a totally different call signature as compared to the other two, I think there is little to be gained (or saved wrt code lines) without adding unneeded complexity. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
How about adding a new method of "WaitUntilNotDisplayed" which could do the following check.
BTW, the existing method of "WaitUntilNotPresent" checks if an element is presented on the web page or not, and does not care if it is displayed or not. And I ran into situations that need to WaitUntilNotDisplayed and made a function myself.
Beta Was this translation helpful? Give feedback.
All reactions