Selenium grid. How to make node to use special firefox profile.

3,298 views
Skip to first unread message

Michael

unread,
Aug 22, 2011, 12:50:13 PM8/22/11
to Selenium Users
Hello All,
I'm trying to launch grid with special firefox profile, so I use the
following command to launch nodes:
java -jar selenium-server-standalone-2.4.0.jar -firefoxProfileTemplate
c:\profiles\selenium -role wd -hub http://localhost:4444/grid/register
-port 5555
But when test started it doesn't use this profile.
Could you please advice, what's wrong here?

François Reynaud

unread,
Aug 22, 2011, 1:57:22 PM8/22/11
to seleniu...@googlegroups.com
hi,

the profile is set at the test level using the capability object with webdriver. It's different from rc where it was hardcoded to the node.

thanks,
François


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


Michael

unread,
Aug 23, 2011, 4:04:25 AM8/23/11
to Selenium Users
I understood right, that there's no way to set profile if we use grid?
I mean, may be there's some flag that can set profile for node?
Or : " -firefoxProfileTemplate c:\profiles\selenium" will not work at
all? I hope that I just do something wrong and that's why it doesn't
work:)

On Aug 22, 9:57 pm, François Reynaud <francois.reyn...@gmail.com>
wrote:
> hi,
>
> the profile is set at the test level using the capability object with
> webdriver. It's different from rc where it was hardcoded to the node.
>
> thanks,
> François
>
> On Mon, Aug 22, 2011 at 5:50 PM, Michael <michael.cherka...@gmail.com>wrote:
>
>
>
>
>
>
>
> > Hello All,
> > I'm trying to launch grid with special firefox profile, so I use the
> > following command to launch nodes:
> > java -jar selenium-server-standalone-2.4.0.jar -firefoxProfileTemplate
> > c:\profiles\selenium -role wd -hubhttp://localhost:4444/grid/register

Michael

unread,
Aug 23, 2011, 4:30:01 AM8/23/11
to Selenium Users
I re-read you message.
> the profile is set at the test level using the capability object with webdriver.
I didn't find how to set this over capabilities object, could you
please post example?
And should we add some flags or settings to nodes?

On Aug 22, 9:57 pm, François Reynaud <francois.reyn...@gmail.com>
wrote:
> hi,
>
> the profile is set at the test level using the capability object with
> webdriver. It's different from rc where it was hardcoded to the node.
>
> thanks,
> François
>
> On Mon, Aug 22, 2011 at 5:50 PM, Michael <michael.cherka...@gmail.com>wrote:
>
>
>
>
>
>
>
> > Hello All,
> > I'm trying to launch grid with special firefox profile, so I use the
> > following command to launch nodes:
> > java -jar selenium-server-standalone-2.4.0.jar -firefoxProfileTemplate
> > c:\profiles\selenium -role wd -hubhttp://localhost:4444/grid/register

Krishnan Mahadevan

unread,
Aug 23, 2011, 4:36:16 AM8/23/11
to seleniu...@googlegroups.com
Here's how you can get it done.

DesiredCapabilities capability = new DesiredCapabilities();
capability.setBrowserName(DesiredCapabilities.firefox().getBrowserName());
FirefoxProfile profile = new ProfilesIni().getProfile("MySeleniumProfile");
capability.setCapability(FirefoxDriver.PROFILE, profile);
RemoteWebDriver webDriver = new RemoteWebDriver(MY_HUB_URL, capability);

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

François Reynaud

unread,
Aug 23, 2011, 8:27:23 AM8/23/11
to seleniu...@googlegroups.com
grid doesn't add or remove any feature. It has all the RemoteWebDriver features.

Using remote webdriver, you can specify the profile you want to use by specifying it in the Capability object. It will then be serialized and sent to the driver.
The same mechanism works on grid.
This is more flexible than RC nodes as you can have the same node runnings a different firefox profile for each test.

thanks,
François

Michael

unread,
Aug 23, 2011, 9:27:21 AM8/23/11
to Selenium Users
Thanks a lot, now it's work. Amazing that now selenium can send
profile to other box.
But appears new issue, Jenkins server(where test are run) hasn't
installed firefox and any profiles,
looks like Se2 required new infrastructure.

On Aug 23, 12:36 pm, Krishnan Mahadevan
<krishnan.mahadevan1...@gmail.com> wrote:
> Here's how you can get it done.
>
> DesiredCapabilities capability = new DesiredCapabilities();
> capability.setBrowserName(DesiredCapabilities.firefox().getBrowserName());
> FirefoxProfile profile = new ProfilesIni().getProfile("MySeleniumProfile");
> capability.setCapability(FirefoxDriver.PROFILE, profile);
> RemoteWebDriver webDriver = new RemoteWebDriver(MY_HUB_URL, capability);
>
> Thanks & Regards
> Krishnan Mahadevan
>
> "All the desirable things in life are either illegal, expensive, fattening
> or in love with someone else!"
>

robbie....@nokia.com

unread,
Aug 23, 2011, 3:05:39 PM8/23/11
to seleniu...@googlegroups.com
I use Jenkins and don't have problems.

I don't think that the Jenkins servers have FF installed. I have always assumed that the fact I am using the Profile object negates the need for FF to be installed.

Michael

unread,
Aug 24, 2011, 4:12:07 AM8/24/11
to Selenium Users
You right, but anyway, with RC you need not to have any profiles on
jenkins, with Se2 you should locate profile on the same box where code
executed.

robbie....@nokia.com

unread,
Aug 24, 2011, 4:28:40 AM8/24/11
to seleniu...@googlegroups.com
Yes, i use webdriver, but do not use an existing profile. I create a ne profile programmatically so therefore do not need a default profile

Sricharan Chandrasekar

unread,
Jun 3, 2014, 3:36:09 AM6/3/14
to seleniu...@googlegroups.com

Hi,

I am using selenium with phpunit. I am new to selenium and looking to run a node in windows with a hub in linux. Not able to start the required firefox profile in the node system. Only a Temp firefox profile is created. I am not sure where to add the above code. Can u plz help.

Thanks in advance.

Krishnan Mahadevan

unread,
Jun 3, 2014, 5:38:02 AM6/3/14
to Selenium Users
Sricharan,
Firefox profile is now something that can be dynamically provided by your test from the client side to the grid.

So the code that I shared above should suffice.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.

To post to this group, send email to seleniu...@googlegroups.com.

Sricharan Chandrasekar

unread,
Jun 4, 2014, 3:05:36 AM6/4/14
to seleniu...@googlegroups.com
Hi Krishnan,

Ok I got the point you have mentioned. I started my firefox profile in my node as follows java -jar selenium-server-standalone-2.41.0.jar -role node -hub http://192.168.56.106:4444/grid/register -firefoxProfileTemplate "C:\Users\sri\Desktop\selenium_firefox" . But still I am not able to start the firefox selenium profile. As per your code I can understand that it will start the required selenium profile. But I am not sure where to place this code.
Reply all
Reply to author
Forward
0 new messages