Always Getting 'Error: Timeout Of 2000ms Exceeded' With Selenium
Good morning, I am currently learning how to drive Selenium with javascript (using mocha). I created a really basic test that is giving me a lot of trouble at runtime. Whenever I
Solution 1:
The error message you get looks like a Mocha timeout to me. The normal way to set a timeout in Mocha is:
it("foo", function () {
this.timeout(value);
...
});
where value
is whatever value you want (in ms). A value of 0 turns off Mocha's timeouts. The default is 2000ms.
Solution 2:
IF it fail somewhere in particular consistently maybe you should be considering calling driver.Manage().Timeouts()
.
ImplicitlyWait()
doesn't actually wait like a Thread.sleep()
does, it just sets the drivers maximum wait time for implicit waits. Just calling it once at the start of your code (with 20 second parameter passed in) is sufficient. Read up on ImplicitlyWait and the WebDriverWait class.
As far as I remember (when I had to used) this is caused because you don't get the response in the expected/by default time.
Post a Comment for "Always Getting 'Error: Timeout Of 2000ms Exceeded' With Selenium"