How to start Selenium with Firefox Portable?



  • 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?



  • 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.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2