The connection has timed out Error using Selenium Webdriver

0 votes

When I run selenium script for the opening gmail.com in Eclipse it does not get loaded and shows an error: "The connection has timed out the server at www.demo.guru99.com is taking too long to respond. "

Apr 17, 2018 in Selenium by Martin
• 4,320 points

edited Apr 17, 2018 by Martin 7,244 views

1 answer to this question.

0 votes

Try to use implicit waits to ensure that the objects are available to selenium.

Include this code in @BeforeTest or @BeforeSuite annotation which ensure the entire test suite will not run if this fails. You can also use try/catch to catch the error and throw exception. Choose whatever is best solution in your case

public static Boolean IsObjectExists(WebDriver driver, By locator) {

        driver.manage().timeouts().implicitlyWait(500, TimeUnit.MILLISECONDS);

        try {

            driver.findElement(locator);

            driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

            return true;

        } catch (NoSuchElementException e) {

            driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

            return false;

        }

answered Apr 17, 2018 by niki

Related Questions In Selenium

0 votes
1 answer

Java.lang.CharSequence cannot be resolved error while using sendKeys() using Selenium Webdriver

You could try this, myElement .sendKeys(new String[] { ...READ MORE

answered Apr 4, 2018 in Selenium by Johnathon
• 9,090 points
4,335 views
0 votes
2 answers

How to scroll the Page up or down in Selenium WebDriver? (using java)

JavascriptExecutor jsx = (JavascriptExecutor)driver; jsx.executeScript("window.scrollBy(0,555)", ""); or Action classes ...READ MORE

answered Sep 6, 2020 in Selenium by Sri
• 3,190 points
18,486 views
0 votes
1 answer

How can I download the *.jar file from http:// seleniumhq.org using selenium WebDriver?

For Selenium Standalone Server use this: profile.setPreference("browser.helperApps.neverAsk.saveToDisk", "application/java-archive"); and ...READ MORE

answered Apr 9, 2018 in Selenium by Martin
• 4,320 points
3,237 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
12,711 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
8,607 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
6,680 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,551 views
0 votes
1 answer

Headless ChromeDriver using Python Selenium error: Fails To Start— “DevTools request failed”

This should be because your ChromeDriver is ...READ MORE

answered Mar 30, 2018 in Selenium by nsv999
• 5,500 points
1,643 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP