2012-02-20

selenium - problem with loading x_ignore_nofocus.so

selenium - problem with loading x_ignore_nofocus.so

Problem

Selenium fails to start Firefox with following error:

'The browser appears to have exited before we could connect.
The output was: Failed to dlopen /usr/lib/libX11.so.6\ndlerror
says: /usr/lib/libX11.so.6: wrong ELF class: ELFCLASS32\n'

In my case it was reproduced on the 64 bit machine with Amazon Linux AMI. The problem itself is known and there is an issue in selenium tracker.

It is because x_ignore_nofocus library tries to load 32bit version of the libX11 instead of 64bit. In my system there are following versions of libX11:

# find / | grep libX11.so.6 | xargs file

/usr/lib64/libX11.so.6:     symbolic link to `libX11.so.6.3.0'
/usr/lib64/libX11.so.6.3.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped
/usr/lib/libX11.so.6:       symbolic link to `libX11.so.6.3.0'
/usr/lib/libX11.so.6.3.0:   ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped

Solution

Change symbolic link /usr/lib/libX11.so.6 to point to the 64-bit version /usr/lib64/libX11.so.6.3.0:

# mv /usr/lib/libX11.so.6 /usr/lib/libX11.so.6.bak
# ln -s /usr/lib64/libX11.so.6.3.0 /usr/lib/libX11.so.6

After that selenium started to work.

Links

bug report.

2 comments:

  1. Thanks, very helpful, I have the same problem in a Fedora 17 64bits.

    ReplyDelete
  2. You rock man. This works for me.

    ReplyDelete