I run several tests on a Selenium grid containing multiple nodes using a dynamically created Firefox profile, for example:
$firefoxProfile = new FirefoxProfile(); $capabilities = DesiredCapabilities::firefox (); $capabilities->setCapability(FirefoxDriver::PROFILE, $firefoxProfile); $this->webdriver = RemoteWebDriver::create("http://my.tests.com", $capabilities, 5000);
But each time the hub selects a node with a previous instance of Firefox, it uses the same profile and discards the previous session. This is because the application uses the same cookies for authentication purposes.
Is there a way to get the selenium grid to create a new profile on the fly and get a completely new instance of firefox?
Additional Information
To start the hub, I currently use the following command line
java -jar /opt/selenium/selenium-server.jar -trustAllSSLCertificates -timeout 300 \ -role hub -newSessionWaitTimeout 60 -maxSession 2 \ -port 9444 -nodeTimeout 300 \ -browserTimeout 300 &
And to run the nodes I use
xvfb-run -n 99 --server-args="-screen 0 800x600x16 -ac" \ -a java -jar /opt/selenium/selenium-server.jar -role node \ -browser browserName=firefox,maxInstances=2 \ -hub http://my.tests.com:9444/grid/register
The strange thing is that when I set up a standalone Selenium server, it creates multiple instances of firefox, as I would like to be ...
php selenium webdriver
Omar alves
source share