Running Selenium Test in Firefox with Robot Framework on Mac OS X Results in Hanging Selenium Server / Blank Browser Window
-
08-12-2019 - |
题
I'm interested in using the robot framework for test automation.
I created a test script that uses
- Robot Framework v2.6.3 (powered by Python v2.6.1)
- SeleniumLibrary for Robot v2.8
- Selenium Server v2.3
My operating system is Mac OS X 10.6.8 (Snow Leopard).
My test runs fine on Google Chrome using the Chrome driver. Chrome, however, does not support taking page screenshots, which is a feature I can't do without.
So I tried running the test in Firefox v10.0.2, which supports page screenshots, and this does not work.
When I start the test, a Firefox window pops up, displaying a blank page, and nothing happens until I kill the pybot.
I tried both with Robot starting up the Selenium Server and starting the Selenium server myself from the command line, to no avail.
I also tried setting up a clean Firefox profile for the server to use, which didn't help either.
I also tried the more recent Selenium2Library for Robot Framework (v0.5.2), works fine in Chrome, but not in Firefox.
I also tried a much simpler, "hello world" type test, basically just opening up www.google.com - still no luck with Firefox.
In all these cases, the behavior is the same:
- Empty Firefox window opens up
- Robot framework prints the name of the test case, then stops
- Selenium server says "Launching Firefox", then stops
The Selenium server's log file shows an endless list of this:
21:06:33.285 DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - waiting for window 'null' local frame 'null' for 1800 more secs
21:06:33.286 DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - waiting for condition for 1000 more ms
21:06:34.288 DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - got condition? : false
21:06:34.300 DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - waiting for window 'null' local frame 'null' for 1799 more secs
21:06:34.300 DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - waiting for condition for 1000 more ms
21:06:35.300 DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - got condition? : false
21:06:35.300 DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - waiting for window 'null' local frame 'null' for 1798 more secs
21:06:35.301 DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - waiting for condition for 1000 more ms
21:06:36.301 DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - got condition? : false
...and so on.
I also tried running the demo for the SeleniumLibary (http://code.google.com/p/robotframework-seleniumlibrary/wiki/Demo), with the same result.
To make sure the issue is with the Robot framework, I created a Java Selenium test which uses Firefox - this works.
Is there anybody out there experiencing the same issues? Does anyone know how to fix this? Any help is greatly appreciated.
My test script looks like this:
*** Settings ***
Resource resource.txt
*** Test Cases ***
Hello World
Open browser to http://www.google.de/
resources.txt:
*** Settings ***
Library SeleniumLibrary
#Library Selenium2Library
*** Variables ***
${BROWSER} firefox
#${BROWSER} googlechrome
*** Keywords ***
Open browser to ${URL}
Open browser ${URL} ${BROWSER}
Thanks and best regards, Patrick
解决方案
I found out that the problem is the version 2.3 of the Selenium server I was using. My tests work with the older version 2.15 of the server.