3
votes

I'm trying use to selenium with firefox on CentOS from command line like this:

java -jar selenium-server-standalone-2.19.0.jar -interactive

Then, I type: cmd=getNewBrowserSession&1=*firefox&2=http://www.google.com

Then it stucks on "Preparing Firefox profile..." part and crashes:

13:59:13.105 INFO - Preparing Firefox profile... 13:59:33.366 ERROR - Failed to start new browser session, shutdown browser and clear all session data

Please help me solve this, I'm quite new to the unix world. Thanks!

3
Do you have firefox installed?Pavel Janicek
Of course! The problem as far as I understand is that it cannot display on console. So I saw on web advice to set export DISPLAY=:0.0, but it still does not helpPavel Dubinin
Do you have a GUI installed? You need one for Selenium to work because it opens selenium in the GUI. When you say command line do you mean a terminal run through the GUI or a terminal only login?Ardesco

3 Answers

2
votes

Are you pointing directly to the firefox executable, or are you pointing to an alias?

By default selenium should be pointing to your selenium binary, what is in /usr/bin is usually a script that interacts with the firefox executable.

1
votes

you could define a specific firefox profile (you have to create it first):

java -jar selenium-server.jar -log SeleniumServer.log -firefoxProfileTemplate "PROFILEPATH" -interactive
1
votes

And for those wondering, if you're at the command line, you can create a profile like this:

firefox -CreateProfile profilename