Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
anj21
Posts : 4
Join date : 2010-12-11

Unable to run selenium tests for server running in background Empty Unable to run selenium tests for server running in background

Sat Dec 11, 2010 11:53 am
I am running my selenium server in background with the help of nssm service. I am running the server at a particular port (11111).

I wrote some unit test in VS 2010 and when I am trying to invoke the selenium service with

Code:
selenium = new DefaultSelenium("localhost", 11111, "*iehta", "http://www.google.co.in");
selenium.Start()

it gives me error "Unable to connect to the remote server". Please help.
Advisor
Advisor
------------------------
------------------------
Posts : 387
Join date : 2009-07-30
Location : India
https://seleniumforum.forumotion.net

Unable to run selenium tests for server running in background Empty Re: Unable to run selenium tests for server running in background

Sat Dec 11, 2010 12:48 pm
I think problem with you or port or you have not started the selenium server if using older version.

My advice is to use is to first start your selenium server manually and try to execute the command and see whether are you able to start with this port.


command:

> java -jar selenium-server.jar -interactive -port 11111

If server will start , conrgrats your port is working fine. now type the following commands:

cmd=getNewBroserSession&1=*iehta&2=http://www.google.co.in
cmd=open&1=http://www.google.co.in



If all will works then your selenium server is working fine. may be you forgot something to attach like jar or specific in your ide.

Hope this will help. Best of luck.

avatar
anj21
Posts : 4
Join date : 2010-12-11

Unable to run selenium tests for server running in background Empty Re: Unable to run selenium tests for server running in background

Sat Dec 11, 2010 12:56 pm
Thanks for the reply. I tried to run the selenium server manually with the above command and it ran successfully.

However i cannot get where should I type the commands

cmd=getNewBroserSession&1=*iehta&2=http://www.google.co.in
cmd=open&1=http://www.google.co.in

I tried typing in command window after stopping server with Ctrl+C but did not work.
Advisor
Advisor
------------------------
------------------------
Posts : 387
Join date : 2009-07-30
Location : India
https://seleniumforum.forumotion.net

Unable to run selenium tests for server running in background Empty Re: Unable to run selenium tests for server running in background

Sat Dec 11, 2010 1:30 pm
after your server start in interactive mode, then you have to type those command there only .

so the server will execute your all command line by line
avatar
anj21
Posts : 4
Join date : 2010-12-11

Unable to run selenium tests for server running in background Empty Re: Unable to run selenium tests for server running in background

Sat Dec 11, 2010 1:35 pm
Ok. So here's the output I get after running the command

cmd=getNewBroserSession&1=*iehta&2=http://www.google.co.in 12:01:35.352 INFO - ---> Requesting http://localhost:11111/selenium-server/driver?cmd=getNewBroserSession&1=*iehta&2=http://www.google.co.in&sessionId=12:01:35.415 INFO - Checking Resource aliases 12:01:35.418 INFO - Command request: getNewBroserSession[*iehta, http://www.google.co.in] on session 12:01:35.424 ERROR - Exception running 'getNewBroserSession 'command on session

java.lang.RuntimeException: sessionId doesn't exist; perhaps this session was already stopped?

cmd=open&1=http://www.google.co.in
12:02:17.824 INFO - ---> Requesting http://localhost:11111/selenium-server/driver?cmd=open&1=http://www.google.co.in&sessionId=
12:02:17.832 INFO - Command request: open[http://www.google.co.in, ] on session 12:02:17.832 ERROR - Exception running 'open 'command on session

java.lang.RuntimeException: sessionId doesn't exist; perhaps this session was already stopped?
Advisor
Advisor
------------------------
------------------------
Posts : 387
Join date : 2009-07-30
Location : India
https://seleniumforum.forumotion.net

Unable to run selenium tests for server running in background Empty Re: Unable to run selenium tests for server running in background

Sat Dec 11, 2010 8:45 pm
Sorry one typo error is there, I mistype the browser. Just add 'w' in that and it will sure work.
avatar
anj21
Posts : 4
Join date : 2010-12-11

Unable to run selenium tests for server running in background Empty Re: Unable to run selenium tests for server running in background

Sat Dec 11, 2010 11:40 pm
Running the command worked and a new browser window was opening. However when my server runs in background and I typed

awstat -a

I could not see port 11111 in the list. That means my port is not being listened to. Any help in this?
avatar
admod
Posts : 4
Join date : 2010-09-29

Unable to run selenium tests for server running in background Empty Selenium RC not Working in Fedora 12

Tue Dec 21, 2010 11:37 am
Hi Friends,
According to your Suggestion I Run the interactive shell and reach there and give first command as
you say: cmd=getNewBrowserSession&1=*iehta&2=http://www.google.co.in But
I got Result a response code of 500 like Below:

Code:
10:08:10.958 INFO - ---> Requesting http://localhost:11111/selenium-server/driver?cmd=getNewBrowserSession&1=*iehta&2=http://www.google.co.in
10:08:10.967 INFO - Command request: getNewBrowserSession[*iehta, http://www.google.co.in] on session null
10:08:10.967 INFO - creating new remote session
10:08:10.971 WARN - GET /selenium-server/driver/?cmd=getNewBrowserSession&1=*iehta&2=http://www.google.co.in HTTP/1.1
java.lang.RuntimeException: SystemRoot apparently not set!
        at org.openqa.selenium.server.browserlaunchers.WindowsUtils.findSystemRoot(WindowsUtils.java:275)
        at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.findHTALaunchLocation(HTABrowserLauncher.java:42)
        at org.openqa.selenium.server.browserlaunchers.HTABrowserLauncher.<init>(HTABrowserLauncher.java:28)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
        at org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory.createBrowserLauncher(BrowserLauncherFactory.java:124)
        at org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory.getBrowserLauncher(BrowserLauncherFactory.java:81)
        at org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession(BrowserSessionFactory.java:307)
        at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:113)
        at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:78)
        at org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession(SeleniumDriverResourceHandler.java:653)
        at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:410)
        at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:388)
        at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:135)
        at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
        at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
        at org.mortbay.http.HttpServer.service(HttpServer.java:909)
        at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
        at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
        at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
        at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
        at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
        at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
Server returned HTTP response code: 500 for URL: http://localhost:11111/selenium-server/driver/?cmd=getNewBrowserSession&1=*iehta&2=http://www.google.co.in

How this problem can remedy, the selenium RC is running fine , but the problem is that, I am working in
Fedora core 12 box. Waiting your Fast Reply

Thankfully
Anes P.A
Sponsored content

Unable to run selenium tests for server running in background Empty Re: Unable to run selenium tests for server running in background

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