java.io.IOException: Error writing to server

211 views
Skip to first unread message

Venkata Nukala

unread,
Sep 23, 2010, 2:15:28 PM9/23/10
to seleniu...@googlegroups.com
Hi,
 
I am new to selenium and i started learning it.
I have created Junit test case in Eclipse with the following code
 

import

static org.junit.Assert.*;

import

org.junit.Test;

import

org.openqa.selenium.server.SeleniumServer;

import

com.thoughtworks.selenium.DefaultSelenium;

import

com.thoughtworks.selenium.Selenium;

public

class Google {

@Test

public void testLogin() {

Selenium selenium =

new DefaultSelenium("localhost", 4444, "*firefox",

"http://www.google.com");

selenium.start();

selenium.open(

"");

selenium.waitForPageToLoad(

"15000");

String actualTitle = selenium.getTitle();

String expectedTitle =

"Google";

assertEquals(expectedTitle,actualTitle);

selenium.close();

selenium.stop();

}

@Test

public void testMoehtod(){

}

}

i started the selenium RC server by executing the command "java -jar selenium-server.jar" and i can see that the server has been started but when i am executing the program i see the follwong error
 

java.io.IOException

: Error writing to server

at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown Source)

at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown Source)

at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)

at java.net.HttpURLConnection.getResponseCode(Unknown Source)

at com.thoughtworks.selenium.HttpCommandProcessor.getResponseCode(

HttpCommandProcessor.java:144)

at com.thoughtworks.selenium.HttpCommandProcessor.getCommandResponseAsString(

HttpCommandProcessor.java:164)

at com.thoughtworks.selenium.HttpCommandProcessor.executeCommandOnServlet(

HttpCommandProcessor.java:104)

at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(

HttpCommandProcessor.java:86)

at com.thoughtworks.selenium.HttpCommandProcessor.getString(

HttpCommandProcessor.java:262)

at com.thoughtworks.selenium.HttpCommandProcessor.start(

HttpCommandProcessor.java:223)

at com.thoughtworks.selenium.DefaultSelenium.start(

DefaultSelenium.java:92)

at Google.testLogin(

Google.java:16)

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 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(

FrameworkMethod.java:44)

at org.junit.internal.runners.model.ReflectiveCallable.run(

ReflectiveCallable.java:15)

at org.junit.runners.model.FrameworkMethod.invokeExplosively(

FrameworkMethod.java:41)

at org.junit.internal.runners.statements.InvokeMethod.evaluate(

InvokeMethod.java:20)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(

BlockJUnit4ClassRunner.java:76)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(

BlockJUnit4ClassRunner.java:50)

at org.junit.runners.ParentRunner$3.run(

ParentRunner.java:193)

at org.junit.runners.ParentRunner$1.schedule(

ParentRunner.java:52)

at org.junit.runners.ParentRunner.runChildren(

ParentRunner.java:191)

at org.junit.runners.ParentRunner.access$000(

ParentRunner.java:42)

at org.junit.runners.ParentRunner$2.evaluate(

ParentRunner.java:184)

at org.junit.runners.ParentRunner.run(

ParentRunner.java:236)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(

JUnit4TestReference.java:49)

at org.eclipse.jdt.internal.junit.runner.TestExecution.run(

TestExecution.java:38)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(

RemoteTestRunner.java:467)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(

RemoteTestRunner.java:683)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(

RemoteTestRunner.java:390)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(

RemoteTestRunner.java:197)
it will be great if any one help me in this regard.
 
Thanks
Venkat
 

Venkat

unread,
Sep 23, 2010, 2:23:15 PM9/23/10
to Selenium Users
but when i am executing the program i see the following error
Reply all
Reply to author
Forward
0 new messages