Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Response_Code = -1 Error_Message = Request Error

View previous topic View next topic Go down

Response_Code = -1 Error_Message = Request Error

Post by utbipin on 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.

utbipin

Posts : 2
Join date : 2010-11-15

Back to top Go down

Re: Response_Code = -1 Error_Message = Request Error

Post by bgsraju on Wed Nov 17, 2010 3:39 pm

Hi,
Can you post your code so that i can know where the error is coming.

bgsraju

Posts : 3
Join date : 2010-11-17

Back to top Go down

Re: Response_Code = -1 Error_Message = Request Error

Post by utbipin on 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.

utbipin

Posts : 2
Join date : 2010-11-15

Back to top Go down

Re: Response_Code = -1 Error_Message = Request Error

Post by bgsraju on 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

bgsraju

Posts : 3
Join date : 2010-11-17

Back to top Go down

Re: Response_Code = -1 Error_Message = Request Error

Post by Sponsored content Today at 1:08 am


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum