ExpectedConditions Obsolete?

149 views
Skip to first unread message

mawa316

unread,
Mar 27, 2018, 3:24:28 PM3/27/18
to Selenium Users
Hi all,

I just had to upgrade my Selenium packages in my solution from 3.6 to 3.11.  When I opened the solution I noticed that ExpectedConditions now appears to be obsolete and will not be supported in a future version...



My code used something like this...

wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("//span[contains(text(), 'No records found')]")))


What am I supposed to use now?

mawa316

unread,
Mar 27, 2018, 4:26:20 PM3/27/18
to Selenium Users
After adding the required package, the ExpectedConditions became SeleniumExtras.WaitHelpers.ExpectedConditions.

Ray Yu

unread,
Feb 13, 2020, 10:50:11 PM2/13/20
to Selenium Users
Sorry if this is too late. It seems like it will be obsolete for C# only. Please correct me if this is wrong. 

Joseph Conlin

unread,
Feb 14, 2020, 12:48:56 PM2/14/20
to Selenium Users
Jim Evans, the volunteer who maintains the .NET bindings and other parts of Selenium, wrote a blog post that talks about this.  You can find it here.

An excerpt:
In this case, the question of code verbosity does have some merit, but since wait conditions are rarely one-size-fits-all, it would be a much cleaner approach for users to develop their own conditions class that has the wait conditions they're interested in. This, however, is something users have an aversion to. Additionally, the thought of a "standard" collection of implementations of specific wait conditions seems to be a good idea on its face, but there is a great deal of variation on the way users want any given condition to work. Having a collection of wait conditions might be a good thing, but the Selenium project is not the place for it.

That makes me think that I can use the moved ExpectedConditions in at least two ways.  1. Use them directly if they do what I need them to do.  2. Use the source code as an example of how to write my own wait conditions if I have a need for something a little different than what is already there.  I find that those two options pertain to other languages as well as C#.

To my knowledge, the .NET bindings are the only ones that have chosen to deprecate / move these items for the time being, but that doesn't mean that other language bindings won't make a change at some point in the future.

Joe
Reply all
Reply to author
Forward
0 new messages