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,220 points
215 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,130 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
• 56,160 points
5,845 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 20, 2018 in Selenium by king_kenny
• 3,590 points
98 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,400 points
1,177 views
0 votes
1 answer

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,050 points
248 views
0 votes
1 answer
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,130 points
621 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
240 views
0 votes
1 answer
0 votes
1 answer