- chandannj
- Posts : 1
Join date : 2012-06-06
Unable to run Selenium RC scripts in Firefox and Google chrome; running fine with "IE".
Wed Jun 13, 2012 1:03 pm
Hi,
I'm unable to run very simple Selenium RC scripts in Firefox and
Google chrome; running fine with "IE".
I'm new to Selenium and was thinking to start using this tool.
I have been struggling with this from 2 weeks.
Here goes my script and error message...
Script 1 (Driver.java):
package Selenium_test_package;
import junit.framework.Test;
import junit.framework.TestSuite;
import junit.textui.TestRunner;
public class Driver{
public static void main(String[] args){
Test tst = SuiteToRun();
TestRunner.run(tst);
}
public static Test SuiteToRun(){
TestSuite suite = new TestSuite();
suite.addTestSuite(LoginLogout.class);
return suite;
}
}
Script 2 (LoginLogout.java):
package Selenium_test_package;
import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class LoginLogout extends SeleneseTestCase {
@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost", 8080, "*firefox",
"http://demo.actitime.com/");
selenium.start();
}
@Test
public void testLoginLogout() throws Exception {
selenium.open("/login.do");
selenium.type("name=username", "admin");
selenium.type("name=pwd", "manager");
selenium.click("id=loginButton");
selenium.waitForPageToLoad("30000");
selenium.click("link=Logout");
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
}
Error message:
.E
Time: 39.28
There was 1 error:
1)
testLoginLogout(Selenium_test_package.LoginLogout)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 Selenium_test_package.LoginLogout.testLoginLogout(LoginLogout.java:
17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at
com.thoughtworks.selenium.SeleneseTestCase.runBare(SeleneseTestCase.java:
212)
at Selenium_test_package.Driver.main(Driver.java:11)
FAILURES!!!
Tests run: 1, Failures: 0, Errors: 1
Thanks in advance,
Chandan.
I'm unable to run very simple Selenium RC scripts in Firefox and
Google chrome; running fine with "IE".
I'm new to Selenium and was thinking to start using this tool.
I have been struggling with this from 2 weeks.
Here goes my script and error message...
Script 1 (Driver.java):
package Selenium_test_package;
import junit.framework.Test;
import junit.framework.TestSuite;
import junit.textui.TestRunner;
public class Driver{
public static void main(String[] args){
Test tst = SuiteToRun();
TestRunner.run(tst);
}
public static Test SuiteToRun(){
TestSuite suite = new TestSuite();
suite.addTestSuite(LoginLogout.class);
return suite;
}
}
Script 2 (LoginLogout.java):
package Selenium_test_package;
import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class LoginLogout extends SeleneseTestCase {
@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost", 8080, "*firefox",
"http://demo.actitime.com/");
selenium.start();
}
@Test
public void testLoginLogout() throws Exception {
selenium.open("/login.do");
selenium.type("name=username", "admin");
selenium.type("name=pwd", "manager");
selenium.click("id=loginButton");
selenium.waitForPageToLoad("30000");
selenium.click("link=Logout");
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
}
Error message:
.E
Time: 39.28
There was 1 error:
1)
testLoginLogout(Selenium_test_package.LoginLogout)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 Selenium_test_package.LoginLogout.testLoginLogout(LoginLogout.java:
17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at
com.thoughtworks.selenium.SeleneseTestCase.runBare(SeleneseTestCase.java:
212)
at Selenium_test_package.Driver.main(Driver.java:11)
FAILURES!!!
Tests run: 1, Failures: 0, Errors: 1
Thanks in advance,
Chandan.
- Selenium WebDriver - Scripts are not running through Jenkins where as working fine locally - Mac OS
- Selenium RC with Google Chrome on Windows server 2008
- Unable to execute selenium scripts from eclipse
- Not able to run application on google chrome with Selenium RC server
- Running Selenium RC test script in Firefox under Linux.
Permissions in this forum:
You cannot reply to topics in this forum