hello friends,
I am new to selenium tool. I recorded a script with selenium IDE and
save that script in java(JUNIT). The file is as follow:
import junit.framework.*;
import com.thoughtworks.selenium.*;
import java.util.regex.Pattern;
public class First extends SeleneseTestCase {
public void setUp() throws Exception {
setUp("
http://www.google.co.in/", "*chrome");
}
public void testUntitled() throws Exception {
selenium.open("/");
selenium.type("q", "selenium");
selenium.click("//input[@value='Google Search' and
@type='button']");
selenium.waitForPageToLoad("30000");
selenium.click("link=Selenium web application testing system");
selenium.waitForPageToLoad("30000");
selenium.click("link=Documentation");
selenium.waitForPageToLoad("30000");
}
public static Test Suite(){
return new TestSuite(First.class);
}
public static void main(String args[]){
junit.textui.TestRunner.run(Suite());
}
}
I have compile the java file and it is showing no error. After that
i started the selenium server and write a command on the terminal
$ java First
and it is showing the following error.. Please help me to remove this
error.
[root@01HW278704 TestCases]# java First
.E
Time: 39.909
There was 1 error:
1) testUntitled(First)com.thoughtworks.selenium.SeleniumException:
Timed out after 30000ms
at
com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:
97)
at
com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:
91)
at
com.thoughtworks.selenium.DefaultSelenium.open(DefaultSelenium.java:
335)
at First.testUntitled(First.java:11)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at
com.thoughtworks.selenium.SeleneseTestCase.runBare(SeleneseTestCase.java:
212)
at First.main(First.java:24)
FAILURES!!!
Tests run: 1, Failures: 0, Errors: 1