Unable to run localhost app via Selenium Server

101 views
Skip to first unread message

MikeC

unread,
Jan 7, 2010, 10:46:49 AM1/7/10
to Selenium Users
Hi,

I've started to use Selenium to test a web app I'm creating. The app
is running locally on my box, and to access it you go to
http://localhost:4020/my_app. The web app appears in the browser, no
problems. When I try to use Selenium RC to open the web app using
Apple's Safari, the web browser will open after telling selenium
server to start a new session, but then nothing happens after. When I
try to run the RC to access, say, google.com and automate a search
then everything works fine. Here's the simple task I'm trying to
accomplish using the ruby selenium client:

require "rubygems"
gem "selenium-client", ">=1.2.16"
require "selenium/client"

begin
@browser = Selenium::Client::Driver.new \
:host => "localhost",
:port => 4444,
:browser => "*safari",
:url => "http://localhost:4020",
:timeout_in_second => 60

@browser.start_new_browser_session
@browser.open "/my_app"
ensure
@browser.close_current_browser_session
end

This is what appears in the browser's address bar when starting a new
session:

http://localhost:4020/selenium-server/core/RemoteRunner.html?sessionId=91cb8f5c4ee44e2490b32bf10e4f0229&multiWindow=false&baseUrl=http%3A%2F%2Flocalhost%3A4020&debugMode=false

Although the URL is in the address bar, the browser remains blank. In
the Selenium server proxy log, the last entry says the following:

10:05:45.503 INFO - Launching Safari to visit
http://localhost:4020/selenium-server/core/RemoteRunner.html?sessionId=91cb8f5c4ee44e2490b32bf10e4f0229&multiWindow=false&baseUrl=http%3A%2F%2Flocalhost%3A4020&debugMode=false
via /var/folders/Bb/BbjEpZ0THT82z3d5b8AZZk+++TI/-Tmp-/
customProfileDir91cb8f5c4ee44e2490b32bf10e4f0229/
redirect_to_go_to_selenium.htm...

From what I can tell, the server is not receiving the request from the
browser in order to process the command. Again, if I try to run the
script by calling google.com then everything works just fine. Is there
something I'm not doing correctly to access the web app on the local
host?

As some extra information, I'm running the web app, browser and
selenium server all on a Mac OS X system (v10.6).

Mike

Jayakumar

unread,
Jan 8, 2010, 1:41:14 AM1/8/10
to Selenium Users

Try run the tests, after setting the Safari browser to "allow pop-
ups".

Thanks,
Jayakumar


On Jan 7, 8:46 pm, MikeC <michael.lee.co...@gmail.com> wrote:
> Hi,
>
> I've started to use Selenium to test a web app I'm creating. The app

> is running locally on my box, and to access it you go tohttp://localhost:4020/my_app. The web app appears in the browser, no


> problems. When I try to use Selenium RC to open the web app using
> Apple's Safari, the web browser will open after telling selenium
> server to start a new session, but then nothing happens after. When I
> try to run the RC to access, say, google.com and automate a search
> then everything works fine. Here's the simple task I'm trying to
> accomplish using the ruby selenium client:
>
>    require "rubygems"
>    gem "selenium-client", ">=1.2.16"
>    require "selenium/client"
>
>    begin
>      @browser = Selenium::Client::Driver.new \
>                  :host => "localhost",
>                  :port => 4444,
>                  :browser => "*safari",
>                  :url => "http://localhost:4020",
>                  :timeout_in_second => 60
>
>      @browser.start_new_browser_session
>      @browser.open "/my_app"
>    ensure
>      @browser.close_current_browser_session
>    end
>
> This is what appears in the browser's address bar when starting a new
> session:
>

> http://localhost:4020/selenium-server/core/RemoteRunner.html?sessionI...


>
> Although the URL is in the address bar, the browser remains blank. In
> the Selenium server proxy log, the last entry says the following:
>

> 10:05:45.503 INFO - Launching Safari to visithttp://localhost:4020/selenium-server/core/RemoteRunner.html?sessionI...

Reply all
Reply to author
Forward
0 new messages