Where does selenium script pick browser from

60 views
Skip to first unread message

rg

unread,
Nov 11, 2013, 6:43:47 AM11/11/13
to seleniu...@googlegroups.com
I am working in a windows environment. I have a perl based selenium script with the following statement :

$sel = Test::WWW::Selenium->new( host => "localhost",
                                port => 4444,
                                browser => "*chrome",
                                browser_url => $ARGV[0]/" );

So, I need the firfox browser to open up a custom profile. To do that i have configured a firefox shortcut with the -P "profilename" appended to target. Now how do i make Selenium open the firefox browser using the custom firefox shortcut. Is there an environment variable that i can set up to include the path of the custom shortcut to ensure that the browser thrown by my Selenium script uses the firefox profile that i need.

P.S. I cannot change the call to Test::WWW::Selenium->new to include the absolute URL of the browser.

Suren Mohanathas

unread,
Nov 11, 2013, 9:10:18 AM11/11/13
to seleniu...@googlegroups.com
Hi,
I do not use Perl but in java you can use webdriver for firefox to use a custome profile via:
FirefoxProfile profile = new FirefoxProfile();
profile.setAcceptUntrustedCertificates(true);
profile.setAssumeUntrustedCertificateIssuer(true);
profile.setPreference("network.proxy.http_port", proxy.getPort());
profile.setPreference("network.proxy.type", 1);
profile.setPreference("network.proxy.share_proxy_settings", true);
capabilities.setCapability(FirefoxDriver.PROFILE, profile);

and adding that capability to firefox driver.  I know that you can also set firefox to use a specific profile by supplying in the command line when you start the selenium node for firefox using "webdriver.firefox.profile" as part of -browser setting for firefox.

cheers,
Suren
Reply all
Reply to author
Forward
0 new messages