Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98788

How do I add a profile to Firefox WebDriver? [duplicate]

$
0
0

I am automating a website, which needs a FireFox extension.

I created a FireFox profile with the extension and all Preferences, and am trying to boot WebDriver with this profile.

I'm using Selenium 3.141.59 and FireFox 70.0

FirefoxOptions options = new FirefoxOptions();
ProfilesIni profilesIni = new ProfilesIni();
FirefoxProfile profile = profilesIni.getProfile("automacao");
options.setProfile(profile);
System.setProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE, "/home/files/logsGeckodriver.txt");
WebDriver driver = new FirefoxDriver(options);`

I'm trying the way above, but the code above does not work! no error happens, nor does a webdriver open.

In this line he finds the profile

FirefoxProfile profile = profilesIni.getProfile("automacao");

I've tried it too

System.setProperty(FirefoxDriver.SystemProperty.BROWSER_PROFILE, "/home/henrique/.mozilla/firefox/r6eis7qo.automacao");

But this way it instantiates WebDriver, but not with the desired profile.

What am I doing wrong?


Viewing all articles
Browse latest Browse all 98788

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>