- utbipin
- Posts : 2
Join date : 2010-11-15
Response_Code = -1 Error_Message = Request Error
Mon Nov 15, 2010 8:30 pm
Hi,
I am new to Selenium and therefore tried this demo: http://knorrium.info/2010/05/19/a-java-approach-to-selenium/
All were successful except the last part. I did exactly how it is mentioned in the demo.
But I am getting following error. Please help me to resolve it.
Note: I am using all the latest version of the api available: selenium-remote-control-1.0.3 and java 1.6.
com.thoughtworks.selenium.SeleniumException: XHR ERROR: URL = http://demo.opensourcecms.com/wordpress/wp-login.php Response_Code = -1 Error_Message = Request Error
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 com.example.tests.WordPress.testWordPress(WordPress.java:18)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at com.thoughtworks.selenium.SeleneseTestCase.runBare(SeleneseTestCase.java:212)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:76)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
What is causing this error and what is the possible fix.
I am new to Selenium and therefore tried this demo: http://knorrium.info/2010/05/19/a-java-approach-to-selenium/
All were successful except the last part. I did exactly how it is mentioned in the demo.
But I am getting following error. Please help me to resolve it.
Note: I am using all the latest version of the api available: selenium-remote-control-1.0.3 and java 1.6.
com.thoughtworks.selenium.SeleniumException: XHR ERROR: URL = http://demo.opensourcecms.com/wordpress/wp-login.php Response_Code = -1 Error_Message = Request Error
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 com.example.tests.WordPress.testWordPress(WordPress.java:18)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at com.thoughtworks.selenium.SeleneseTestCase.runBare(SeleneseTestCase.java:212)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:76)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
What is causing this error and what is the possible fix.
- bgsraju
- Posts : 3
Join date : 2010-11-17
Re: Response_Code = -1 Error_Message = Request Error
Wed Nov 17, 2010 3:39 pm
Hi,
Can you post your code so that i can know where the error is coming.
Can you post your code so that i can know where the error is coming.
- utbipin
- Posts : 2
Join date : 2010-11-15
Re: Response_Code = -1 Error_Message = Request Error
Wed Nov 17, 2010 5:26 pm
Here is the code:
package com.example.tests;
import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.regex.Pattern;
public class WordPress extends SeleneseTestCase {
@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://demo.opensourcecms.com/");
selenium.start();
}
@Test
public void testWordPress() throws Exception {
selenium.open("/wordpress/wp-login.php");
selenium.waitForPageToLoad("30000");
selenium.type("user_login", "admin");
selenium.type("user_pass", "demo123");
selenium.click("wp-submit");
selenium.waitForPageToLoad("30000");
verifyTrue(selenium.isTextPresent("Howdy, admin"));
selenium.click("link=Posts");
selenium.waitForPageToLoad("30000");
selenium.click("link=Add New");
selenium.waitForPageToLoad("30000");
selenium.type("title", "Selenium Demo Post");
selenium.click("publish");
selenium.waitForPageToLoad("30000");
verifyTrue(selenium.isTextPresent("Post published."));
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
}
The code works fine with the *iexplore but gives problem only with the firefox.
package com.example.tests;
import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.regex.Pattern;
public class WordPress extends SeleneseTestCase {
@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://demo.opensourcecms.com/");
selenium.start();
}
@Test
public void testWordPress() throws Exception {
selenium.open("/wordpress/wp-login.php");
selenium.waitForPageToLoad("30000");
selenium.type("user_login", "admin");
selenium.type("user_pass", "demo123");
selenium.click("wp-submit");
selenium.waitForPageToLoad("30000");
verifyTrue(selenium.isTextPresent("Howdy, admin"));
selenium.click("link=Posts");
selenium.waitForPageToLoad("30000");
selenium.click("link=Add New");
selenium.waitForPageToLoad("30000");
selenium.type("title", "Selenium Demo Post");
selenium.click("publish");
selenium.waitForPageToLoad("30000");
verifyTrue(selenium.isTextPresent("Post published."));
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
}
The code works fine with the *iexplore but gives problem only with the firefox.
- bgsraju
- Posts : 3
Join date : 2010-11-17
Re: Response_Code = -1 Error_Message = Request Error
Wed Nov 17, 2010 7:23 pm
Hi,
It is working fine with the firefox in my machine. I had not changed any thing in the code. The only thing i added the juint-4.0.jar file along with selenium jars. Please check the jar file.
Regards,
Raju
It is working fine with the firefox in my machine. I had not changed any thing in the code. The only thing i added the juint-4.0.jar file along with selenium jars. Please check the jar file.
Regards,
Raju
- Grid2: couldn't register this node : Error sending the registration request.
- ERROR: Command execution failure. Please search the forum at http://clearspace.openqa.org for error details from the log window. The error message is: Permission denied
- Getting the error msg 'Error: Could not find or load main class java-jar' while executing the selenium code in eclipse
- How to capture an AJAX request with SeleniumRC test?
- How to resolve this error---->[error] Element id=ui-active-menuitem not found
Permissions in this forum:
You cannot reply to topics in this forum