robotframework / OldSeleniumLibrary

Deprecated Selenium library for Robot Framework
Apache License 2.0
13 stars 3 forks source link

Document that custom browser needs to be an executable in Linux #53

Closed spooning closed 9 years ago

spooning commented 9 years ago

Originally submitted to Google Code by bryan.oakley on 30 Sep 2009

I have a test that looks like this:

Open Browser    <a href="http://owen.orbitz.net" rel="nofollow">http://owen.orbitz.net</a>  ${BROWSER}              
${title} =  Get Title                   
title should be Owen - Home                 
Capture Screenshot                      
Close Browser                       
[Teardown]  Close All Browsers                  

The windows are never closed. It doesn't matter whether the test fails or succeeds, the windows always remain. This is on RHEL with firefox2.

spooning commented 9 years ago

Originally submitted to Google Code by @pekkaklarck on 30 Sep 2009

I've noticed this behavior sometime when the browser was already running. Just having a browser process running without any visible browser instances was enough. What's your setup? If this is the problem, I'm not entirely sure what could be a valid fix. From the command line you can pass -no-remote to Firefox and something like that might also work with Selenium.

spooning commented 9 years ago

Originally submitted to Google Code by bryan.oakley on 30 Sep 2009

I see the behavior both with a running firefox instance and without.

spooning commented 9 years ago

Originally submitted to Google Code by @yanne on 26 Oct 2009

Do you use selenium in single or multi window mode?

If using multiple windows, could you try starting the Selenium server with option -singleWindow and see whether it helps.

spooning commented 9 years ago

Originally submitted to Google Code by @yanne on 28 Oct 2009

How do you specify which browser to use?

spooning commented 9 years ago

Originally submitted to Google Code by bryan.oakley on 28 Oct 2009

Here's what I have learned:

*firefox /usr/local/firefox/firefox-bin

This setting works -- with this the browser windows close just fine. This path is the path to the actual firefox executable.

*firefox /usr/local/bin/firefox

With this setting the test runs but the browser windows do not close. This path is a symlink to /usr/local/firefox/firefox.

*firefox /usr/local/firefox/firefox

With this setting the test runs but the browser windows do not close. This path is a shell script that eventually runs /usr/local/firefox/firefox-bin

So, the lesson seems to be, if I start the browser by giving a path to the browser binary it works fine. If I give it a path to a symlink or a script that runs the binary it does not. Selenium apparently needs to full path to the actual binary. With hindsight this is not surprising.

spooning commented 9 years ago

Originally submitted to Google Code by @yanne on 25 Nov 2009

This is actually documented also in Selenium RC documentation [1]. We should add a mention to our documentation about this too.

spooning commented 9 years ago

Originally submitted to Google Code by @yanne on 25 Nov 2009

And here's the missing link: http://seleniumhq.org/docs/05_selenium_rc.html#supporting-additional-browsers-and-browser-configurations