File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Testing and the fly likes Selenium RC Junit test case does not execute. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Selenium RC Junit test case does not execute." Watch "Selenium RC Junit test case does not execute." New topic

Selenium RC Junit test case does not execute.

Divya Sudarsan

Joined: Feb 16, 2010
Posts: 9
Hi ,

I am currently learning selenium RC. I tried to run my junit selenium test case, it opens two firefox windows and then wait for the web page http://localhost:4444/selenium-server/core/Blank.html?start=true on one of the windows and eventually times out.

The web page intended to open also doesnt open.

Please let me know the issue.


22:45:36.145 INFO - Command request: getNewBrowserSession[*firefox, http://www.g, ] on session null
22:45:36.145 INFO - creating new remote session
22:45:36.145 INFO - Allocated session 9d0e1f4b80854fd3a02c6b048f621e65 for http:
//, launching...
22:45:36.192 INFO - Preparing Firefox profile...
22:45:38.380 INFO - Launching Firefox...
22:45:40.489 INFO - Got result: OK,9d0e1f4b80854fd3a02c6b048f621e65 on session 9
22:45:40.489 INFO - Command request: open[/, ] on session 9d0e1f4b80854fd3a02c6b
22:46:10.613 INFO - Got result: Timed out after 30000ms on session 9d0e1f4b80854
22:46:10.613 INFO - Command request: testComplete[, ] on session 9d0e1f4b80854fd
22:46:10.613 INFO - Killing Firefox...
22:46:10.769 INFO - Got result: OK on session 9d0e1f4b80854fd3a02c6b048f621e65

My Junit Code

// We specify the package of our tests

import com.thoughtworks.selenium.*;
// This is the driver's import. You'll use this for instantiating a
// browser and making it do what you need.

public class HelloSeleniumTest extends SeleneseTestCase {
// We create our Selenium test case

public void setUp() throws Exception {
setUp("", "*firefox");
// We instantiate and start the browser

public void testNew() throws Exception {"/");
selenium.type("q", "selenium rc");"btnG");
assertTrue(selenium.isTextPresent("Results * for selenium rc"));
// These are the real test steps

Kiran Shigli

Joined: Oct 04, 2008
Posts: 7
Try putting the mozilla home directory path in the env variable PATH.

rumija ho

Joined: May 24, 2011
Posts: 2

I am also getting the same type of error with IE. For the first time when i run it is redirecting to C:\Users\<login user>\AppData\Local\Temp\customProfileDir*\core\Blank.html.

and in the server log :

15:14:14.755 INFO - Java: Sun Microsystems Inc. 16.3-b01
15:14:14.755 INFO - OS: Windows 7 6.1 x86
15:14:14.755 INFO - v1.0-beta-2 [2571], with Core v1.0-beta-2 [2330]
15:14:14.815 INFO - Version Jetty/5.1.x
15:14:14.815 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
15:14:14.815 INFO - Started HttpContext[/selenium-server,/selenium-server]
15:14:14.815 INFO - Started HttpContext[/,/]
15:14:14.825 INFO - Started SocketListener on
15:14:14.825 INFO - Started org.mortbay.jetty.Server@f73c1
15:14:19.614 INFO - Checking Resource aliases
15:14:19.624 INFO - Command request: getNewBrowserSession[*iexplore, http://localhost:8080/test, ] on session null
15:14:19.624 INFO - creating new remote session
15:14:19.754 INFO - Allocated session 4ec4ea0a2db742d59c0aa64098f34775 for http://localhost:8080/test, launching...
15:14:19.814 INFO - Launching Embedded Internet Explorer...
15:14:20.824 INFO - Launching Internet Explorer HTA...

and stops for some time after that it is showing the timeout errormessage.

Please help me on this.


s lekkala

Joined: Jul 25, 2011
Posts: 14
I am new to selenium. I have doubts in the code can anyone clarify it...

why we should use setUp() and tearDown() methods...???

and its not working is there any mistake in the code??

package com.sreenu;

import com.thoughtworks.selenium.Selenium;
import com.thoughtworks.selenium.DefaultSelenium;
import junit.framework.TestCase;
import org.openqa.selenium.server.SeleniumServer;

public class ExampleTest
extends TestCase
private static final String MAX_WAIT_TIME_IN_MS = "60000";
private static final String BASE_URL = "";
private Selenium selenium = new DefaultSelenium( "localhost",
private SeleniumServer seleniumServer;
public void setUp()
throws Exception
seleniumServer = new SeleniumServer();

public void tearDown()
throws Exception

public void testClickingLink()
throws Exception
Thread.sleep(20000);"css=a.gbzt.gbzt-hvr > span.gbts");
selenium.type("Email", "gmail address");
selenium.type("Passwd", "password");"signIn");

//String expectedTitle = "Bit Motif ยป Test Page For Selenium Remote Control";
//assertEquals(expectedTitle, selenium.getTitle());

I agree. Here's the link:
subject: Selenium RC Junit test case does not execute.
It's not a secret anymore!