Gangmax Blog

Selenium problem resolved: hung at "Preparing Firefox profile..." in Ubuntu 10.04/Firefox 3.6

Today When I wanted to run Selenium server I found it hung at “Preparing Firefox profile…” and didn’t open a firefox window. After doing some google work I found the problem happened because the “selenium-server.jar” doesn’t support firefox 3.6.*, which was installed with Ubuntu 10.04(Firefox 3.6.3). The solution I found is to change the firefox version configuration in the “selenium-server.jar” file. Then the problem resolved.

今天在我的Ubuntu 10.04上运行Selenium的时候发现问题:当试图打开一个firefox窗口时,server控制台打印“Preparing Firefox profile…”然后无反应。经过搜索发现问题出在“selenium-server.jar”不支持最新的firefox 3.6.*, 而Ubuntu 10.04安装的firefox版本是正是3.6.3,所以产生问题。解决方案的思路是修改“selenium-server.jar”文件中关于firefox版本的配置,使其能够支持3.6.*版本。具体的步骤如下:

From: http://www.qaautomation.net/?p=15

Patching Selenium server to support Firefox 3.6

These steps should work for you on Unix, Mac or cygwin on windows. In case you are not using any of these, you would need to figure out the corresponding steps for our platform.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Create a directory where you could manipulate the jar’s contents.
cd ~/selenium101
# Copy your selenium-server.jar file in the newly created directory and cd into it.
cp selenium-server.jar ~/selenium101/.
# Unzip the jar files contents here and delete the jar file.
unzip selenium-server.jar
rm selenium-server.jar
# First find all the *.rdf files – you should see 5 of them:
find . -name "*.rdf"
./customProfileDirCUSTFF/extensions/{538F0036-F358-4f84-A764-89FB437166B4}/install.rdf
./customProfileDirCUSTFF/extensions/readystate@openqa.org/install.rdf
./customProfileDirCUSTFFCHROME/extensions/{503A0CD4-EDC8-489b-853B-19E0BAA8F0A4}/install.rdf
./customProfileDirCUSTFFCHROME/extensions/{538F0036-F358-4f84-A764-89FB437166B4}/install.rdf
./customProfileDirCUSTFFCHROME/extensions/readystate@openqa.org/install.rdf
# In each of these files you will see:
<em:maxVersion>3.5.*</em:maxVersion>
# Change them to:
<em:maxVersion>3.6.*</em:maxVersion>
# All the files are now patched. To jar them back up run the following steps:
zip -r selenium-server *

Comments