Reputation: 166
I want to block popup in selenium using firefox driver.
has anyone done anything like this? i have had tried by loading extension but no success.
Can anyone help here?
Thanks!
Regards, Kalpesh Patel
Upvotes: 0
Views: 1287
Reputation: 424
You need to use your browser profile and block popup there. Pass your profile as a parameter while creating instance of your browser. check the code below:
ProfilesIni allProfiles = new ProfilesIni();
FirefoxProfile profile = allProfiles.getProfile("Your-profile-name");
profile.setPreference( "intl.accept_languages", "no,en-us,en" );
FirefoxDriver driver = new FirefoxDriver(profile);
driver.get("http://www.example.com/");
Note: I consider that you already know the concept of profile in browser.
Upvotes: 1