Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I want to use Selenium Server on Windows 7 with a FirefoxPortable as browser, starting the selenium-server-standalon JAR file. My first attempt was without a profile, just like this:

java -jar selenium-server-standalone-2.33.0.jar 
     -htmlSuite "*firefox C:\Users\rplantik\Portables\selenium\FirefoxPortable\FirefoxPortable.exe" 
      "http://127.0.0.1"    
      "C:\Users\rplantik\Portables\selenium\rest\testsuite.html" 
      "testresults.html"

The Jetty server was started, but it crushed after having issued the info message Preparing Firefox profile...

I found out that there is another portable app, called FirefoxPortable2ndProfile, which allows you to start FirefoxPortable with another than the built-in profile. I therefore downloaded that application, too, and modified the command as follows, to include the path to the different profile:

java -jar selenium-server-standalone-2.33.0.jar 
     -firefoxProfileTemplate C:\Users\rplantik\Portables\selenium\FirefoxPortable2ndProfile\Data\profile 
     -htmlSuite "*firefox C:\Users\rplantik\Portables\selenium\FirefoxPortable\FirefoxPortable.exe" 
      "http://127.0.0.1"    
      "C:\Users\rplantik\Portables\selenium\rest\testsuite.html" 
      "testresults.html"

Now it seems that the profile was created successfully (Preparing Firefox profile... seems to be executed as intended - for a short moment, the "Firefox" logo pops up), then the message Launching Firefox... appears, and indeed a firefox application is started.

But after that, the test suite is not executed. Instead, the browser stays on the default site, and there is no further action until I stop the process in the console.

How to use Selenium with Firefox Portable?

share|improve this question
    
Why are you passing testsuite.html and testresults.html as arguments to the command to start Selenium server/grid ? JUnit test results have nothing to do with the grid server. Those are properties of the JUnit test runner. –  djangofan Aug 15 '13 at 23:34

1 Answer 1

Rather than try to configure the profile manually in your code, which will limit you if you plan to run tests multi-threaded, I would start a Selenium "grid node" which is configured to user a manually specified profile directory. Then you could run like 5 Firefox's per machine/node in parallel. You just load your grid node from a JSON config file and configure the firefox profile parameter.

share|improve this answer
    
My question was simply how to start selenium-server.jar with Firefox Portable. I am not interested in those Firefox profiles in itself, I only want to get the thing running. "Grid node" sounds cool, but I am not confident that a grid will work if not even a single instance is runnable. –  rplantiko Aug 15 '13 at 5:45
1  
The answer is that you start Firefox Portable, configure the browser to your liking, then close the browser, THEN find the profile directory and copy that directory to wherever you want. Then, configure the Grid hub to point to that directory in the JSON config. Otherwise, you can do the same thing in code when you are defining the driver and specifying the Capabilities object, etc. Also, Selenium has a Profile class where you can generate a new profile and locate it whereever you want on the file system. –  djangofan Aug 15 '13 at 20:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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