Search code examples
unit-testingseleniumselenium-rcweb-testing

Selenium, Using multiple firefoxProfileTemplates at once / specifying from selenium object rather than at server launch?


I am using Selenium RC for website testing and I need to use multiple proxies at once and am doing this using: firefoxProfileTemplate when I start the selenium server. This, however, doesn't allow me to multi-thread selenium as each selenium object still uses the same firefoxProfileTemplate, and therefore the same proxy, (I am using Python to control / interact with selenium) as they all have the same proxy.

I am wondering if there is a way to specify the firefoxProfileTemplate when I launch the selenium object / open a web page with selenium rather than just when I launch the server. Alternatively, is there a way to run multiple instances of the selenium server and specify which one to interact with? Thanks for any advice.


Solution

  • Since Selenium Rc is the mechanism to start browser the only way to do what you want is with multiple rc instances. When starting it add -port #### and give your instances unique port numbers.

    When you create a selenium object you do sel = Selenium('localhost', ####, '*firefox', 'http://foo.bar')

    As a side note in Selenium 2 which is in alpha you can build all of this programatically since there is no reliance on RC.