3
votes

I have started selenium server using below command and I wanted to use custom firefox profile. But some how it creates a new firefoxprofile in /tmp/ directory for each test case I run.

/usr/bin/java -jar /usr/local/groundwork/selenium/java/selenium-server-standalone-2.33.0.jar -firefoxProfileTemplate /root/.mozilla/firefox/lfmvce8i.selenium/ &

When I check firefox process using below command I can see that temporary profile has been created in /tmp directory.

root 35660 4.6 12.9 810852 131352 pts/0 Sl 10:10 0:10 /usr/lib64/firefox/firefox -profile /tmp/customProfileDirf4461dd4c0fd4b388a595f159568fd4b root 35934 0.0 0.0 103244 840 pts/0 S+ 10:14 0:00 grep firefox

Can someone please help me to use custom firefox profile with selenium.

2

2 Answers

3
votes

The option firefoxProfileTemplate is not valid anymore.

Use webdriver.firefox.profile instead.

Your command should be

/usr/bin/java -jar /usr/local/groundwork/selenium/java/selenium-server-standalone-2.33.0.jar -Dwebdriver.firefox.profile=selenium &

See: http://code.google.com/p/selenium/wiki/FirefoxDriver

Note that -Dwebdriver.firefox.profile takes the NAME of the profile as parameter, not the path.

0
votes

I am also trying to get the selenium standalone to use a custom firefox profile. By calling the selenium-server from the commandline in a batch file.

I've seen in other posts about custom firefox profile, that the parameter -firefoxProfileTemplate is not valid. If that is the case, why is it listed in the help?

java -jar selenium-server-standalone-2.44.0.jar -h

-firefoxProfileTemplate <dir>: normally, we generate a fresh empty
    Firefox profile every time we launch.  You can specify a directory
    to make us copy your profile directory instead.

I also cant see any difference wether or not I use -firefoxProfileTemplate <path-to-profile> or -Dwebdriver.firefox.profile=<name-of-profile>

java -jar selenium-server-standalone-2.44.0.jar -htmlSuite "*googlechrome" "http://qa-map-pat.valtech.dk" "Test/TESTSUITE.html" "results.html"

Another related issue I'm seing is that I am unable to set the path to the firefox.exe file. I've tried to set it using -Dwebdriver.firefox.bin "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" but it is like this option is just ignored. Instead I had to add the path to my PATH environment variable in Windows.

So it seems to me that the options supplied when calling the selenium server from the commandline are not properly handled?