3

I use Selenium (standalone version) for testing websites. I used the ChromeDriver, but I tested it also with the FirefoxDriver.

My Problem: I get a java.net.SocketTimeoutException, by calling websites on first time, if they load very slow. It seems, that selenium dont want to wait, until the website built completely. If I run the application again, it works sometimes, because the website loads faster (caching maybe).

After searching on Google I found ways to set the timeouts, but it doesn't work:

driver.manage().timeouts().pageLoadTimeout(60, TimeUnit.SECONDS);
driver.manage().timeouts().setScriptTimeout(60, TimeUnit.SECONDS);
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);

What can I do, that Selenium will wait for slower websites directly? I hope somebody can help me with this problem.

4
  • Increase your timeout values. Commented Feb 12, 2018 at 19:03
  • I've worked with Protractor.js and it uses selenium under the hood; I had to do what @RyanWilson said to do in my config. Commented Feb 12, 2018 at 19:09
  • selenium version? Commented Feb 12, 2018 at 23:32
  • Possible duplicate of Selenium shows java.net.SocketException: Connection reset Commented Feb 13, 2018 at 7:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.