Unable to run the selenium RC script with Firefox on Windows 7

1,381 views
Skip to first unread message

sam6

unread,
May 19, 2011, 5:22:27 AM5/19/11
to Selenium Users
Hi,

I am trying to run my RC script (which runs perfectly for IE ) on
mozilla 3.6 on my Win 7 machine..
After launching the browser,the script doesnot even open the
applications and hangs and nothing happens or proceeds

Can you please let me know if there is any thing required to fix this.

SelBrowser = new DefaultSelenium("localhost",4444,"*iexplore","http://
abc-126");

and in hosting the RC

C:\Users\user1>java -jar C:\Selenium\selenium-server-
standalone-2.0b3.jar -port 4444 -forcedBrowserMode *firefox

thanks
sam6

Mark Collin

unread,
May 19, 2011, 6:06:28 AM5/19/11
to seleniu...@googlegroups.com
Are you getting any errors? Any info from the logs?

Hi,

thanks
sam6

--
You received this message because you are subscribed to the Google Groups
"Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to
selenium-user...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/selenium-users?hl=en.


--
This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.

If you have received this email in error please notify postm...@ardescosolutions.com

sam6

unread,
May 19, 2011, 6:22:26 AM5/19/11
to Selenium Users
No error or no info logged.
I am using TestNG..so no error logged in eclipse as well.

RC server is up and running with last info showing firefox launched..

pls help
thanks
Sam6
> For more options, visit this group athttp://groups.google.com/group/selenium-users?hl=en.
>
> --
> This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.
>
> If you have received this email in error please notify postmas...@ardescosolutions.com

AJ

unread,
May 19, 2011, 6:49:05 AM5/19/11
to Selenium Users
What is the error or commands that you see in the selenium-server
window?

sam6

unread,
May 19, 2011, 6:58:26 AM5/19/11
to Selenium Users
java -jar C:\Selenium\selenium-server-standalone-2.0b3.jar -port 5555
forcedBrowserMode firefox

in java code:

_browser = new DefaultSelenium("localhost",4444,"*iexplore","http://
servername");

thx
sam6

AJ

unread,
May 19, 2011, 8:38:59 AM5/19/11
to Selenium Users
Thats not what we are looking for.
When you execute java -jar **** server.jar -port ****, you should be
running that in a command prompt or terminal. Once you run your tests,
there will be some additional logging shown in that command prompt.
Let us know what are the last log statements that you see in this
window after your tests fail. That would help in determining the
cause.

sam6

unread,
May 20, 2011, 12:27:02 AM5/20/11
to Selenium Users
My test is not ending up in failed state,the firefox browser is
launched and nothing happens further even after 10 mins

however below is the log in cmd prompt:

C:\Program Files (x86)\Support Tools>java -jar C:\Selenium\selenium-
server-standalone-2.0b3.jar -port 4444
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
Picked up _JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:C:\PROGRA~2\HP
\QUICKT~1\bin\JAVA_S~1\classes;C:\PROGRA~2\HP\QUICKT~1\bin
\JAVA_S~1\classes\jasmine.jar
09:53:57.764 INFO - Java: Sun Microsystems Inc. 19.0-b09
09:53:57.765 INFO - OS: Windows 7 6.1 x86
09:53:57.770 INFO - v2.0 [b3], with Core v2.0 [b3]
09:53:57.876 INFO - RemoteWebDriver instances should connect to:
http://127.0.0.1:4444/wd/hub
09:53:57.877 INFO - Version Jetty/5.1.x
09:53:57.878 INFO - Started HttpContext[/selenium-server/driver,/
selenium-server
/driver]
09:53:57.878 INFO - Started HttpContext[/selenium-server,/selenium-
server]
09:53:57.879 INFO - Started HttpContext[/,/]
09:53:57.900 INFO - Started
org.openqa.jetty.jetty.servlet.ServletHandler@4e280c

09:53:57.900 INFO - Started HttpContext[/wd,/wd]
09:53:57.903 INFO - Started SocketListener on 0.0.0.0:4444
09:53:57.903 INFO - Started org.openqa.jetty.jetty.Server@ae506e
09:54:08.955 INFO - Checking Resource aliases
09:54:08.959 INFO - Command request: getNewBrowserSession[*iexplore,
http://localhost:4444, ] on session null
09:54:08.961 INFO - creating new remote session
09:54:08.973 INFO - Allocated session 7da8bca8004142cf875f16f9c9d8c6f8
for http://localhost:4444, launching...
09:54:09.070 INFO - Launching Embedded Internet Explorer...
09:54:09.079 INFO - Launching Internet Explorer HTA...
09:54:12.210 INFO - Got result: OK,7da8bca8004142cf875f16f9c9d8c6f8 on
session 7da8bca8004142cf875f16f9c9d8c6f8
09:54:12.219 INFO - Command request:
setContext[CreateProjBTest.testNewProj_Create, ] on session
7da8bca8004142cf875f16f9c9d8c6f8
09:54:12.242 INFO - Got result: OK on session
7da8bca8004142cf875f16f9c9d8c6f8
09:54:12.247 INFO - Command request: getNewBrowserSession[*firefox C:
\Program Files (x86)\Mozilla Firefox 4.0 Beta 12\firefox.exe, http://servername,
] on session null
09:54:12.247 INFO - creating new remote session
09:54:12.251 INFO - Allocated session 4a69dcc3935b4eba976f25c36bf07754
for http://servername, launching...
09:54:12.289 INFO - Preparing Firefox profile...
09:54:14.187 INFO - Launching Firefox...

The forefox browser gets launched but the test script doesnot get
executed.

thx
sam6

Lutfi Dughman

unread,
May 20, 2011, 2:32:30 AM5/20/11
to seleniu...@googlegroups.com
why are u launching IE and firefox at the same time



09:54:09.070 INFO - Launching Embedded Internet Explorer...
09:54:09.079 INFO - Launching Internet Explorer HTA...


09:54:12.247 INFO - Command request: getNewBrowserSession[*firefox C:
\Program Files (x86)\Mozilla Firefox 4.0 Beta 12\firefox.exe, http://servername,
] on session null


you do realize you have 2 sessions, check the sessions ids in the log

sam6

unread,
May 20, 2011, 2:47:04 AM5/20/11
to Selenium Users
sorry forgot to provide -forcedBrowserMode firefox

I reran with all the options and below is the log:

C:\niku\main\build>java -jar C:\Selenium\selenium-server-
standalone-2.0b3.jar -port 4444 -forcedBrowserMode firefox
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
Picked up _JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:C:\PROGRA~2\HP
\QUICKT~1\bin\JAVA_S~1\classes;C:\PROGRA~2\HP\QUICKT~1\bin
\JAVA_S~1\classes\jasmine.jar
Warning: -forcedBrowserMode no longer consumes all remaining arguments
on line (use -forcedBrowserModeRestOfLine for that)
12:12:29.734 INFO - Java: Sun Microsystems Inc. 11.3-b02
12:12:29.754 INFO - OS: Windows Vista 6.1 x86
12:12:29.754 INFO - v2.0 [b3], with Core v2.0 [b3]
12:12:29.764 INFO - "firefox" will be used as the browser mode for all
sessions, no matter what is passed to getNewBrowserSession.
12:12:29.884 INFO - RemoteWebDriver instances should connect to:
http://127.0.0.1:4444/wd/hub
12:12:29.894 INFO - Version Jetty/5.1.x
12:12:29.894 INFO - Started HttpContext[/selenium-server/driver,/
selenium-server/driver]
12:12:29.904 INFO - Started HttpContext[/selenium-server,/selenium-
server]
12:12:29.904 INFO - Started HttpContext[/,/]
12:12:29.934 INFO - Started
org.openqa.jetty.jetty.servlet.ServletHandler@6cb8
12:12:29.934 INFO - Started HttpContext[/wd,/wd]
12:12:29.944 INFO - Started SocketListener on 0.0.0.0:4444
12:12:29.944 INFO - Started org.openqa.jetty.jetty.Server@6e70c7
12:12:50.150 INFO - Checking Resource aliases
12:12:50.160 INFO - Command request: getNewBrowserSession[*iexplore,
http://localhost:4444, ] on session null
12:12:50.160 INFO - overriding browser mode w/ forced browser mode
setting: firefox
12:12:50.160 INFO - creating new remote session
12:12:50.220 INFO - Allocated session 3d276f78ed2841fdaadc5c1bb37b1c74
for http://localhost:4444, launching...
12:12:50.290 INFO - Preparing Firefox profile...
12:12:52.224 INFO - Launching Firefox...

and after this,firefox gets launched but my application is not opened
in the browser and test is never executed...

On May 20, 11:32 am, Lutfi Dughman <lutf...@gmail.com> wrote:
> why are u launching IE and firefox at the same time
>
> 09:54:09.070 INFO - Launching Embedded Internet Explorer...
> 09:54:09.079 INFO - Launching Internet Explorer HTA...
>
> 09:54:12.247 INFO - Command request: getNewBrowserSession[*firefox C:
> \Program Files (x86)\Mozilla Firefox 4.0 Beta 12\firefox.exe,http://servername,
> ] on session null
>
> you do realize you have 2 sessions, check the sessions ids in the log
>
> > forhttp://localhost:4444, launching...
> > 09:54:09.070 INFO - Launching Embedded Internet Explorer...
> > 09:54:09.079 INFO - Launching Internet Explorer HTA...
> > 09:54:12.210 INFO - Got result: OK,7da8bca8004142cf875f16f9c9d8c6f8 on
> > session 7da8bca8004142cf875f16f9c9d8c6f8
> > 09:54:12.219 INFO - Command request:
> > setContext[CreateProjBTest.testNewProj_Create, ] on session
> > 7da8bca8004142cf875f16f9c9d8c6f8
> > 09:54:12.242 INFO - Got result: OK on session
> > 7da8bca8004142cf875f16f9c9d8c6f8
> > 09:54:12.247 INFO - Command request: getNewBrowserSession[*firefox C:
> > \Program Files (x86)\Mozilla Firefox 4.0 Beta 12\firefox.exe,
> >http://servername,
> > ] on session null
> > 09:54:12.247 INFO - creating new remote session
> > 09:54:12.251 INFO - Allocated session 4a69dcc3935b4eba976f25c36bf07754
> > forhttp://servername, launching...

Mark Collin

unread,
May 20, 2011, 3:42:42 AM5/20/11
to seleniu...@googlegroups.com
We will need to see your test code as well to see what you are trying to do.
It looks like you are trying to send commands to a selenium session that has
not been instantiated.

If you have received this email in error please notify postm...@ardescosolutions.com

sam6

unread,
May 20, 2011, 4:44:58 AM5/20/11
to Selenium Users
I am not sending any commands to selenium session,the same code works
perfectly fine with ie browser.

Here is the rest of the cmd prompt log:

12:34:12.102 INFO - Launching Firefox...
13:04:13.887 ERROR - Failed to start new browser session, shutdown
browser and clear all session data
org.openqa.selenium.server.RemoteCommandException: timed out waiting
for window 'null' to appear
at
org.openqa.selenium.server.FrameGroupCommandQueueSet.waitForLoad(FrameGroupCommandQueueSet.java:
564)
at
org.openqa.selenium.server.FrameGroupCommandQueueSet.waitForLoad(FrameGroupCommandQueueSet.java:
521)
at
org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession(BrowserSessionFactory.java:
374)
at
org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:
125)
at
org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:
87)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession(SeleniumDriverResourceHandler.java:
785)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:
422)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:
393)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:
146)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:
1530)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:
1482)
at org.openqa.jetty.http.HttpServer.service(HttpServer.java:
909)
at
org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
at
org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:
986)
at
org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
at
org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:
243)
at
org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.openqa.jetty.util.ThreadPool
$PoolThread.run(ThreadPool.java:534)
13:04:13.895 INFO - Killing Firefox...
13:04:13.991 INFO - Got result: Failed to start new browser session:
Error while launching browser on session null
13:04:14.046 INFO - Command request: captureScreenshot[C:\Selenium
\Samples\SeleniumPoc\test-output\SeleniumPoc\TEST-
setUp7830446166801528972.png, ] on session null
13:04:14.060 INFO - Creating Robot
Loading HP QuickTest Professional Java Support (version 11.0.0.0) (SUN
1.6.0_13)
13:04:15.680 INFO - Got result: OK on session null
13:04:15.701 INFO - Command request: captureScreenshot[C:\Selenium
\Samples\SeleniumPoc\test-output\SeleniumPoc\TEST-
setTestContext4489776001763525766.png, ] on session null
13:04:15.863 INFO - Got result: OK on session null

Below is the log on eclipse console:
[Parser] Running:
C:\Selenium\Samples\SeleniumPoc\temp-testng-customsuite.xml

FAILED CONFIGURATION: @BeforeTest setUp(null, null)
java.lang.RuntimeException: Could not start Selenium session: Failed
to start new browser session: Error while launching browser
at
com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:
90)
at
com.thoughtworks.selenium.SeleneseTestBase.setUp(SeleneseTestBase.java:
133)
at
com.thoughtworks.selenium.SeleneseTestBase.setUp(SeleneseTestBase.java:
100)
at
com.thoughtworks.selenium.SeleneseTestNgHelper.setUp(SeleneseTestNgHelper.java:
30)
Caused by: com.thoughtworks.selenium.SeleniumException: Failed to
start new browser session: Error while launching browser
at
com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:
100)
at
com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:
94)
at
com.thoughtworks.selenium.HttpCommandProcessor.getString(HttpCommandProcessor.java:
265)
at
com.thoughtworks.selenium.HttpCommandProcessor.start(HttpCommandProcessor.java:
226)
at
com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:
82)
... 22 more
... Removed 19 stack frames
FAILED CONFIGURATION: @BeforeMethod setTestContext(public void
works.selenium.test.CreateProjBTest.testNewProj_Create() throws
java.lang.Exception)
java.lang.NullPointerException
at
com.thoughtworks.selenium.SeleneseTestNgHelper.setTestContext(SeleneseTestNgHelper.java:
46)
... Removed 24 stack frames
SKIPPED CONFIGURATION: @AfterMethod checkForVerificationErrors
SKIPPED: testNewProj_Create

===============================================
works.selenium.test.CreateProjBTest
Tests run: 1, Failures: 0, Skips: 1
Configuration Failures: 2, Skips: 1
===============================================


===============================================
SeleniumPoc
Total tests run: 1, Failures: 0, Skips: 1
Configuration Failures: 2, Skips: 1
===============================================

Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
Picked up _JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:C:\PROGRA~2\HP
\QUICKT~1\bin\JAVA_S~1\classes;C:\PROGRA~2\HP\QUICKT~1\bin
\JAVA_S~1\classes\jasmine.jar


thx
sam6
> 12:12:50.160 INFO - Command request: getNewBrowserSession[*iexplore,http://localhost:4444, ] on session null
> 12:12:50.160 INFO - overriding browser mode w/ forced browser mode
> setting: firefox
> 12:12:50.160 INFO - creating new remote session
> 12:12:50.220 INFO - Allocated session 3d276f78ed2841fdaadc5c1bb37b1c74 forhttp://localhost:4444, launching...
> ...
>
> read more »

Mark Collin

unread,
May 20, 2011, 5:17:24 AM5/20/11
to seleniu...@googlegroups.com
This is getting a bit like plucking hens teeth..

Can you provide your test code, so we can see what you are trying to do. It
looks like you are sending commands to a selenium session you have not
started, my guess so far would be that you either have no selenium.start()
in your test or that you do not have the path to your browser set up
correctly in your environmental variables. If I can see your test script I
can getter a better idea as to what the problem is.

Other questions would be, what are you using a robot class for, are you
trying to start a browser with selenium and with QTP at the same time? Of
course if I can see your test script I will probably be able to work all of
this out.

If you have received this email in error please notify postm...@ardescosolutions.com

sam6

unread,
May 20, 2011, 7:13:05 AM5/20/11
to Selenium Users
Below is my code for your reference.
I have set the firefox path in my PATH variable.
The same script works fine with ie but never on firefox

Please help me out.I am using Win 7.

package works.selenium.test;
import java.util.Random;
import com.thoughtworks.selenium.*;
import org.testng.annotations.*;
import works.selenium.test.Locators.LoginPage;
import static org.testng.Assert.*;
import java.util.regex.Pattern;

public class CreateProjBTest extends SeleneseTestNgHelper
{
Selenium _browser =null;
public void setUp() throws Exception
{
_browser = new DefaultSelenium("localhost",4444,"*firefox","http://
servername");
_browser.start();
_browser.open("/app");
_browser.windowMaximize();
Thread.sleep(10000);


}
public void logIn(String userName,Selenium browser_) throws
Exception
{
if(browser_.isElementPresent("ppm_header_logout"))
{
_browser.click("ppm_header_logout");
Thread.sleep(3000);
}

browser_.type( LoginPage.TF_ID_USER_NAME, userName);

browser_.type(LoginPage.TF_ID_USER_PASSWORD, "admin");

browser_.click(LoginPage.BTN_ID_LOGIN);
Thread.sleep(3000);
}


@Test public void testNewProj_Create() throws Exception {
setUp();
logIn("admin", _browser);
Random random = new Random();
String suffix=Integer.toString(random.nextInt(1000));
String proj_name="newproj_"+suffix;
selenium.click("link=Projects");
Thread.sleep(3000);
selenium.click("//button[text()='New']");

selenium.type("unique_code", proj_name);
selenium.type("description", "this is a demo proj for tool
evaluation");

selenium.select("progress", "Started");
selenium.select("status", "Approved");

selenium.click("//button[text()='Save']");

Thread.sleep(3000);
assertTrue(selenium.isTextPresent("All required fields need to be
filled out."));
selenium.type("name", proj_name);
selenium.click("//button[text()='Save']");
Thread.sleep(5000);
selenium.click("//button[text()='Return']");
selenium.click("link=Projects");
Thread.sleep(3000);
selenium.click("//button[text()='New']");

selenium.type("name", proj_name);
selenium.type("unique_code", proj_name);
selenium.click("//button[text()='Save']");

Thread.sleep(3000);
> ...
>
> read more »

Andy Tinkham

unread,
May 20, 2011, 11:13:51 AM5/20/11
to seleniu...@googlegroups.com
This sounds similar to a problem I was having with Firefox on Windows 7. In my case, Selenium was trying to talk to Firefox on port 7055, but FortiClient (my company's VPN software) was already using that port. Rather than the error you got, I got an EOFError in Ruby, but Firefox's behavior was the same - a window came up and then the test hung. It might be good to run netstat -a from a command prompt and check the output for something using the 7055 port. If you don't find anything and no one else has any other suggestions, you can try systematically shutting down apps and services on your machine and seeing which one might be interfering - that's how I initially found that Forticlient was the problem for me.

browser_.type( LoginPage.TF_ID_USER_NAME, userName);

browser_.type(LoginPage.TF_ID_USER_PASSWORD, "admin");

browser_.click(LoginPage.BTN_ID_LOGIN);
Thread.sleep(3000);
}

Thread.sleep(3000);

}
}

--

Mark Collin

unread,
May 23, 2011, 3:35:50 AM5/23/11
to seleniu...@googlegroups.com
Can you debug it and see if browser_ in your login function is null or not.
Could be that you are losing the value of _browser when you are passing it
into the login function because it's not static.

browser_.type( LoginPage.TF_ID_USER_NAME, userName);

browser_.type(LoginPage.TF_ID_USER_PASSWORD, "admin");

browser_.click(LoginPage.BTN_ID_LOGIN);
Thread.sleep(3000);
}

Thread.sleep(3000);

}
}

> com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureEx
> ceptio
> nOrError(HttpCommandProcessor.java:
> 100)
>         at
> com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandPr
> ocesso
> r.java:
> 94)
>         at
> com.thoughtworks.selenium.HttpCommandProcessor.getString(HttpCommandPr
> ocesso
> r.java:
> 265)
>         at
> com.thoughtworks.selenium.HttpCommandProcessor.start(HttpCommandProces
> sor.ja

--

Dilip T

unread,
May 23, 2011, 5:27:42 AM5/23/11
to seleniu...@googlegroups.com
Try this :


  SelBrowser = new DefaultSelenium("localhost",
4444,"*firefox C://Program Files (x86)//Mozilla Firefox//firefox.exe","http://
abc-126");


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.




--
 Dilip Talasila 
“There would be no passion in this world if we never had to fight for
what we love.”


Mark Collin

unread,
May 23, 2011, 5:36:04 AM5/23/11
to seleniu...@googlegroups.com
Actually, looking at this again, you have never defined the selenium object.
You should be using _broswer.click() and _browser.type() in your test, not
selenium.click(). I don't see how this would have worked for IE...

Also you really don't want to use Thread.sleep in your tests..

browser_.type( LoginPage.TF_ID_USER_NAME, userName);

browser_.type(LoginPage.TF_ID_USER_PASSWORD, "admin");

browser_.click(LoginPage.BTN_ID_LOGIN);
Thread.sleep(3000);
}

Thread.sleep(3000);

}
}

> com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureEx
> ceptio
> nOrError(HttpCommandProcessor.java:
> 100)
>         at
> com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandPr
> ocesso
> r.java:
> 94)
>         at
> com.thoughtworks.selenium.HttpCommandProcessor.getString(HttpCommandPr
> ocesso
> r.java:
> 265)
>         at
> com.thoughtworks.selenium.HttpCommandProcessor.start(HttpCommandProces
> sor.ja

--

Reply all
Reply to author
Forward
0 new messages