org.openqa.selenium.TimeoutException

2,792 views
Skip to first unread message

mrigank ved

unread,
Oct 28, 2013, 9:05:40 AM10/28/13
to seleniu...@googlegroups.com
Hi all,

When i am using WebDriverWait class i am getting "org.openqa.selenium.TimeoutException"

my code written

WebDriverWait wait=new WebDriverWait(driver, 10);
System.out.println("waitng2");
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("/html/body/div[3]/div/div/div/div/div/table/tbody/tr/td[3]/nobr/button")));
System.out.println("waitng3");
element=driver.findElement(By.xpath("/html/body/div[3]/div/div/div/div/div/table/tbody/tr/td[3]/nobr/button"));
element.click(); 


On executing i am getting this error.


Exception in thread "main" org.openqa.selenium.TimeoutException: Timed out after 10 seconds waiting for visibility of element located by By.xpath: /html/body/div[3]/div/div/div/div/div/table/tbody/tr/td[3]/nobr/button
Build info: version: '2.33.0', revision: '4e90c97', time: '2013-05-22 15:33:32'
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version: '1.6.0_38-ea'
Driver info: driver.version: unknown
at org.openqa.selenium.support.ui.FluentWait.timeoutException(FluentWait.java:259)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:228)
at com.example.sel.NewSelTEst.openUrl(NewSelTEst.java:35)
at com.example.sel.NewSelTEst.main(NewSelTEst.java:55)
Caused by: org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"xpath","selector":"/html/body/div[3]/div/div/div/div/div/table/tbody/tr/td[3]/nobr/button"}
Command duration or timeout: 13.88 seconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.33.0', revision: '4e90c97', time: '2013-05-22 15:33:32'
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version: '1.6.0_38-ea'
Session ID: 3096800e-5468-4e7c-901f-f34821637204
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, browserName=firefox, rotatable=false, locationContextEnabled=true, version=20.0.1, cssSelectorsEnabled=true, databaseEnabled=true, handlesAlerts=true, browserConnectionEnabled=true, nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=true, takesScreenshot=true}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:191)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:307)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:404)
at org.openqa.selenium.By$ByXPath.findElement(By.java:344)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:299)
at org.openqa.selenium.support.ui.ExpectedConditions.findElement(ExpectedConditions.java:522)
at org.openqa.selenium.support.ui.ExpectedConditions.access$0(ExpectedConditions.java:520)
at org.openqa.selenium.support.ui.ExpectedConditions$4.apply(ExpectedConditions.java:130)
at org.openqa.selenium.support.ui.ExpectedConditions$4.apply(ExpectedConditions.java:1)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:208)
... 2 more
Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: Unable to locate element: {"method":"xpath","selector":"/html/body/div[3]/div/div/div/div/div/table/tbody/tr/td[3]/nobr/button"}
Build info: version: '2.33.0', revision: '4e90c97', time: '2013-05-22 15:33:32'
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version: '1.6.0_38-ea'
Driver info: driver.version: unknown
at <anonymous class>.FirefoxDriver.prototype.findElementInternal_(file:///C:/DOCUME~1/mved/LOCALS~1/Temp/anonymous7200889600551656476webdriver-profile/extensions/fxdr...@googlecode.com/components/driver_component.js:8444)
at <anonymous class>.fxdriver.Timer.prototype.setTimeout/<.notify(file:///C:/DOCUME~1/mved/LOCALS~1/Temp/anonymous7200889600551656476webdriver-profile/extensions/fxdr...@googlecode.com/components/driver_component.js:386)


Thanks in advance.

Shawn McCarthy

unread,
Oct 28, 2013, 10:37:45 AM10/28/13
to seleniu...@googlegroups.com
It seems like your locator could be incorrect, and that it doesn't appear. It is a very brittle locator. Try a different one. Paste part of the html around that button you want, and maybe someone can help.


at <anonymous class>.FirefoxDriver.prototype.findElementInternal_(file:///C:/DOCUME~1/mved/LOCALS~1/Temp/anonymous7200889600551656476webdriver-profile/extensions/fxdri...@googlecode.com/components/driver_component.js:8444)
at <anonymous class>.fxdriver.Timer.prototype.setTimeout/<.notify(file:///C:/DOCUME~1/mved/LOCALS~1/Temp/anonymous7200889600551656476webdriver-profile/extensions/fxdri...@googlecode.com/components/driver_component.js:386)


Thanks in advance.

Krishnan Mahadevan

unread,
Nov 12, 2013, 5:53:22 AM11/12/13
to Selenium Users
Are you sure your locator is valid ?

This error msg seems to suggest that perhaps your locator is not valid here :

Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: Unable to locate element: {"method":"xpath","selector":"/html/body/div[3]/div/div/div/div/div/table/tbody/tr/td[3]/nobr/button"}

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/e288586e-d118-45fc-b110-ad61bbc68dbd%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

abhilash goud

unread,
Feb 26, 2017, 2:27:18 PM2/26/17
to Selenium Users
at <anonymous class>.FirefoxDriver.prototype.findElementInternal_(file:///C:/DOCUME~1/mved/LOCALS~1/Temp/anonymous7200889600551656476webdriver-profile/extensions/fxdri...@googlecode.com/components/driver_component.js:8444)
at <anonymous class>.fxdriver.Timer.prototype.setTimeout/<.notify(file:///C:/DOCUME~1/mved/LOCALS~1/Temp/anonymous7200889600551656476webdriver-profile/extensions/fxdri...@googlecode.com/components/driver_component.js:386)


Thanks in advance.

abhilash goud

unread,
Feb 26, 2017, 2:27:18 PM2/26/17
to Selenium Users

package Executable;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;



public class Class {

public static void main(String[] args) 
{
WebDriver driver=new FirefoxDriver();
);
driver.manage().timeouts().pageLoadTimeout(3,TimeUnit.SECONDS);

WebElement create=driver.findElement(By.id("signup"));
create.click();
driver.manage().timeouts().pageLoadTimeout(3,TimeUnit.SECONDS);

driver.findElement(By.xpath("//input[@type='text']")).clear();
driver.findElement(By.xpath("//input[@type='text']")).sendKeys("abhi");

}

}

this is the error i am getting when i execute


Exception in thread "main" org.openqa.selenium.TimeoutException: Timed out waiting for page load.
Command duration or timeout: 3.06 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:32:46'
System info: host: 'GSK-PC', ip: '192.168.0.16', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=46.0.1, platform=WINDOWS, nativeEvents=false, acceptSslCerts=true, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 7c8fceee-7a48-4f23-8456-011a68fa2631
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:327)
at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:85)
at Executable.Class.main(Class.java:22)
Caused by: org.openqa.selenium.TimeoutException: Timed out waiting for page load.
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:32:46'
System info: host: 'GSK-PC', ip: '192.168.0.16', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_111'
Driver info: driver.version: unknown
at <anonymous class>.Utils.installClickListener/e<(file:///C:/Users/GSK/AppData/Local/Temp/anonymous5379590244460870587webdriver-profile/extensions/fxdr...@googlecode.com/components/command-processor.js:9372)
at <anonymous class>.WebLoadingListener/e(file:///C:/Users/GSK/AppData/Local/Temp/anonymous5379590244460870587webdriver-profile/extensions/fxdr...@googlecode.com/components/command-processor.js:5142)
at <anonymous class>.WebLoadingListener/<(file:///C:/Users/GSK/AppData/Local/Temp/anonymous5379590244460870587webdriver-profile/extensions/fxdr...@googlecode.com/components/command-processor.js:5150)
at <anonymous class>.fxdriver.Timer.prototype.setTimeout/<.notify(file:///C:/Users/GSK/AppData/Local/Temp/anonymous5379590244460870587webdriver-profile/extensions/fxdr...@googlecode.com/components/command-processor.js:625)



Reply all
Reply to author
Forward
0 new messages