Unable to set PageLoad of ChromeDriver instance

Hiding here for a long time, now it's time for my first real post. I am currently developing a cross-browser test for our application with Selenium in .NET.

After http://www.guru99.com/cross-browser-testing-using-selenium.html I implemented this:

[SetUpFixture]
public class TestSetup()
{
    public static IWebDriver driver;
    ...

    [OneTimeSetUp]
    public void GlobalSetup()
    {
        if(browserToTest.Equals("Firefox"))
        {
              driver = new FirefoxDriver();
        }
        else if(browserToTest.Equals("Chrome"))
        {
              driver = new ChromeDriver();
        }

        driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10.00);
        driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(10.00);

        // navigate to url, login, etc. pp
    }
}

In the case of "Firefox" everything works fine. The "Chrome" case - unlike the tutorial - gives me this error:

OneTimeSetUp: System.NotImplementedException: The driver instance must conform to the W3C specification in order to support getting timeout values.

I use:

  • Firefox v54.0
  • Chrome v59.0.3071.115
  • Selenium.WebDriver v3.4.0
  • Selenium.Firefox.WebDriver v0.17.0
  • Selenium.WebDriver.ChromeDriver v2.30.0.1

ImplicitWait PageLoad Chrome, Firefox?

+8
2

, # -Selenium :

public static void SetImplicitWait(this IWebDriver driver, TimeSpan waitTime)
    {
        driver.Manage().Timeouts().ImplicitWait = waitTime;
    }

System.NotImplementedException: W3C .

, .

0

driver.manage().timeouts().implicitlyWait(10,timeunit.seconds)
driver.manage().timeouts().pageLoadTimeout(10,timeunit.seconds)

3

0

Source: https://habr.com/ru/post/1680637/


All Articles