Error Throwing TimeoutException after an element was clicked with true ExpectedConditions

0 votes

I am getting an error on the last line of the code

wd.get("https://www.thehost.com/profile.php");

WebDriverWait wait = new WebDriverWait(wd, 10);

wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("input[value='a_working_locator']"))); //line 224

wd.findElement(By.cssSelector("input[value='a_working_locator']")).click(); //line 225

Below is the error:

org.openqa.selenium.TimeoutException: Timeout loading page after 5000ms Driver info: org.openqa.selenium.firefox.FirefoxDriver Session ID: 78736d2b-3c64-4bec-a205-2ceb16ad8680 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ... org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:83) at main.FirefoxHeadlessServer.run(FirefoxHeadlessServer.java:225) at main.FirefoxHeadlessServer.main(FirefoxHeadlessServer.java:154)

Please help me to resolve it

Jul 2, 2018 in Selenium by Martin
• 4,320 points
3,021 views

1 answer to this question.

0 votes

As you are trying to invoke click() on the same element after invoking WebDriverWait instead of the clause visibilityOfElementLocated use the clause elementToBeClickable as follows :

new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.cssSelector("input[value='a_working_locator']"))).click();
answered Jul 2, 2018 by Samarpit
• 5,910 points

Related Questions In Selenium

0 votes
2 answers

Unable to Click on an Element in Selenium (Python) even after finding it.

Here, I give you working script which ...READ MORE

answered Sep 19, 2018 in Selenium by Priyaj
• 58,090 points
23,467 views
0 votes
1 answer

Need to scroll down for locating an Element with Selenium

There are a couple of options for ...READ MORE

answered Apr 21, 2018 in Selenium by king_kenny
• 3,710 points
12,557 views
0 votes
1 answer

Finding xPath for an element with text

I think the problem is here: [contains(text()='Some text')] To ...READ MORE

answered Jul 31, 2018 in Selenium by Meci Matt
• 9,460 points
10,917 views
0 votes
1 answer
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,728 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,616 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,690 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,555 views
0 votes
1 answer
0 votes
1 answer
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