3

Before updating Selenium.Support Nuget, all test cases in my test suite were running correctly. When I updated the Nuget yesterday, all my test cases in which I use WebDriverWait ExpectedConditions, have stopped working and keep failing at point where WebDriverWait ExpectedConditions are used.

When I check information in my VS 2017 I can notice that there is a message saying that ExpectedConditions is obsolete and it will be removed in the future release. I really do not want to stop using this feature because it was very helpful for me.

My question is do you have any solution or suggestions how can I resolve this issue? I am placing one of my examples method where I use ExpectedConditions.

public bool IsAtHomePage()
    {
        WebDriverWait wait = new WebDriverWait(Browser.WebDriver, TimeSpan.FromSeconds(10));
        wait.Until(ExpectedConditions.VisibilityOfAllElementsLocatedBy(By.Id("custom-tree")));

        return Browser.Url == HomePageUrl;
    }

Thank you for your time and replies

2
  • Have you tried to debug the code to watch the real state of the things before you call wait.Until?
    – Alexey R.
    Mar 16 '18 at 10:39
  • Hello Alexey R. I have tried debugging and it keeps failing at the same point, however, I did some more googling and found out to replace the ExpectedConditions with solution given in this link -> stackoverflow.com/questions/23479538/… Mar 16 '18 at 11:51
3

The set of expected conditions is being removed from the Selenium C# bindings.

Though you can still add them to your library from the source:

https://github.com/SeleniumHQ/selenium/blob/master/dotnet/src/support/UI/ExpectedConditions.cs

Or you can update/migrate your code to use SeleniumExtras.ExpectedConditions, the external library where they are being moved to:

https://github.com/DotNetSeleniumTools/DotNetSeleniumExtras

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.