Hi everyone!
I have created 25 tests using Selenium IDE 1.9.0.
The tests are running in Linux OS and the browser is FirefoxESR.
After running the tests, I get the following error. The error appears randomly in every run. So, I may run them now and I get the error in 2 or 5 or 1 or whatever number of tests. It is so random that I cannot understand what the problem is. Rarely the run is perfect and no error appears!!
The error appears mostly (not always) after the log in to the application I'm testing.
This is my first experience in unit testing and I will appreciate any help. I'm really puzzled.
Please for your help.
Thanks a lot
~apostolos
15/01/2013 16:11:09 - ERROR: gr.pcs.wm.tests.ACLtest: org.openqa.selenium.WebDriverException: waiting for doc.body failed
Command duration or timeout: 13.18 seconds
Build info: version: '2.23.1', revision: '17143', time: '2012-06-08 18:59:28'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.39-200.34.1.el6uek.x86_64', java.version: '1.6.0_37'
Driver info: driver.version: RemoteWebDriver
Session ID: 63fbd652-616d-474f-b310-821492168f3a
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/TbwsxnQIZ0sJ.
For more options, visit https://groups.google.com/groups/opt_out.
That would imply that the JavaScript snippet “return AdfPage.PAGE.isSynchronizedWithServer()” is returning false after 20 seconds.
I would read that as you have an issue with server synchronisation and most likely a bug in the system somewhere.
From: seleniu...@googlegroups.com [mailto:seleniu...@googlegroups.com] On Behalf Of Apostolos Kitsopoulos
Sent: 16 January 2013 09:03
To: seleniu...@googlegroups.com
Subject: Re: [selenium-users] org.openqa.selenium.WebDriverException: waiting for doc.body failed
Mark thanks a lot for your prompt reply.
You are absolutely right about the definition of the unit testing. What I'm doing is functional acceptance testing, as you correctly mention.
The browser is Firefox ESR 10.0.8
The simplest test is just a log in - log out and close the browser. The error would appear 99% right after the line:
waitForPageToFinishRendering(driver, 20000L, "1");
which is actual right after the log in.
public class LogInLogOutTest extends JUnitWmTest {
private Logger logger = Logger.getLogger(this.getClass().getName());
@Test
public void runTest() throws Exception {
try {
this.logInLogOut();
} catch (Exception e) {
logger.error(e);
takeSnapshot("Error_" + this.getClass().getName());
throw e;
}
}
private void logInLogOut(){
logger.info("Start [Test] of " + this.getClass().getName());
driver.get(baseUrl);
//Log in
driver.findElement(By.id("it1::content")).clear();
driver.findElement(By.id("it1::content")).sendKeys("user1");
halfSleep(); // -> Thread.sleep(500L);
driver.findElement(By.id("cb1")).click();
waitForPageToFinishRendering(driver, 20000L, "1");
//Log out
driver.findElement(By.id("pt1:pSt1:pt_cl1")).click();
logger.info("End [Test] of " + this.getClass().getName());
}
}
and the method waitForPageToFinishRendering is actual doin this:
public void waitForPageToFinishRendering(WebDriver oDriver,
Long waitMilliseconds,
String debugString) {
ExpectedCondition e = new ExpectedCondition() {
public Boolean apply(Object d) {
JavascriptExecutor js = (JavascriptExecutor)d;
Boolean isReady =
(Boolean)js.executeScript("return AdfPage.PAGE.isSynchronizedWithServer()");
return isReady;
}
};
logger.info("Timeout for " + waitMilliseconds + " milliseconds... (debug string: " + debugString + ").");
WebDriverWait w = new WebDriverWait(oDriver, waitMilliseconds, 100L);
w.until(e);
}
Any suggestion is welcome!
Thanks in advance
~apostolos
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/t2NV_mzJtbgJ.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/t2NV_mzJtbgJ.