Nikolay
Nikolay

Reputation: 1

How to run firefox browser as a different user with Selenium Webdriver?

I'm trying to run Firefox as a different user in my Selenium tests. How can I tell Selenium to 'run as' a specified user? My application has a windows authentication, and I need to run tests with different roles.

Upvotes: 0

Views: 2141

Answers (1)

Ashish Mishra
Ashish Mishra

Reputation: 31

This can be done by creating Firefox profile, use firefox.exe -p to launch profile manager

Once the profile is created as required use the profile name and launch the driver:

ProfilesIni profile = new ProfilesIni();

FirefoxProfile myprofile = profile.getProfile("profileName");

WebDriver driver = new FirefoxDriver(myprofile);

Hope this helps.

Upvotes: 3

Related Questions