6

I was wondering if anyone has any ideas on how I could find out why I can seem to get firefox running through selenium webdriver. What happens is when I run:

self.driver=webdriver.Firefox()

I get a blank dialogue on my desktop. I am running on Redhat 5.6 and my selenium version is 2.21.3. I debugged the code as far as i can go and from what i can determine the code freezes after bringing up the blank dialog on the following code within the firefox_binary module:

Popen([self._start_cmd, "-slient"], stdout=PIPE, stderr=STDOUT, env=self._filefox_env).wait()

I opened up a cmd prompt and manually ran the abovementioned command and no such blank dialog appears. This would make me think that its not a firefox error. I can not find where the error for this would appear. Any ideas?

update

I installed centos 6 and installed firefox 10.0.6 and selenium webdriver worked with that version

update

Aside from using centos 6 I need this problem to also be solved on redhat so here are more details and what I've found. I will put a bounty on this as it needs to be solved:

I dug a little more on this and found that the problem is with selenium using a 32 bit lib. I have selenium version 2.25.0 on Redhat Enterprise Linux Server release 5.6 (x86_64) using Firefox ESR 10.0.6 (64 bit). I changed the _start_from_profile_path method in the firefoxBinary class to see where the problem lies:

p=open("/tmp/ffoutput.txt", "w+")
Popen([self._start_cmd, "-silent"], stdout=p, stderr=STDOUT, env=self._firefox_env).communicate()

and I tailed /tmp/ffoutput.txt I found that selenium is trying to use a 32 bit lib:

Failed to dlopen /usr/lib/libX11.so.6
dlerror says: /usr/lib/libX11.so.6: wrong ELF class: ELFCLASS32

This message occurs continuously and firefox hangs with a blank dialog showing. I googled this problem and found some people complaining but no solutions that worked (I tried softlinking the 64 bit lib to the 32 bit lib dir after moving the 32 bit lib but this caused geko to crash, I tried sending the continuous errors to /dev/null but this solved nothing).

5
  • No exception, no log? Huh. Has it been ever working, or is this your first try to run FF via WebDriver? Could you try starting Firefox by providing a path to it to the constructor? May 21, 2012 at 10:57
  • Its my first time on a redhat box. I had it running on a windows box. I checked self._start_cmd and found it is the exact correct path to firefox. as I said I checked under debug what command was being used and i found it was /usr/bin/firefox -silent. I ran that in a terminal and got no error. I also ran /usr/bin/firefox (without the -slient) and firefox appears. When webdriver user the abovementioned code firefox does not open and a blank dialog shows in the redhat desktop.
    – amadain
    May 21, 2012 at 11:03
  • there is nothing added to /var/log/messages to tell me anything (where firefox puts its logging).
    – amadain
    May 21, 2012 at 11:05
  • Upvoted and starred. I'm also interested in the cause of this. If nothing helps, you could try the discussion group or official IRC - seleniumhq.org/support, it could just be a bug. May 21, 2012 at 11:07
  • stackoverflow is better than the official IRC at getting answers it seems (from previous questions).
    – amadain
    Jul 24, 2012 at 11:08

1 Answer 1

1
+50

If you are referring to this issue reported in Selenium http://code.google.com/p/selenium/issues/detail?id=2852

The work around on 64Bit linux distros is to issue these commands:

sudo mv /usr/lib/libX11.so.6 /usr/lib/libX11.so.6.old
sudo ln -s /usr/lib64/libX11.so.6.3.0 /usr/lib/libX11.so.6

This worked for me on my box.

1
  • From the 2nd update "I tried softlinking the 64 bit lib to the 32 bit lib dir after moving the 32 bit lib but this caused geko to crash" so unfortunately this did not work for me
    – amadain
    Jul 30, 2012 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.