0

Faced c with the fall of tests due to a geolocation request. Please tell me how to launch the browser without this request?

My code is the calling browser:

System.setProperty("webdriver.opera.driver", "C:/src/test/resources/operadriver.exe");
            OperaOptions options = new OperaOptions();
            options.setBinary(new File("C:/Program Files/Opera/50.0.2762.67/opera.exe"));
            driver = new OperaDriver(options);
            WebDriverRunner.setWebDriver(driver);
  • Possible duplicate of [How can I handle Geo Location popup in mozilla and chrome browser using selenium webdriver?](https://stackoverflow.com/questions/44321401/how-can-i-handle-geo-location-popup-in-mozilla-and-chrome-browser-using-selenium) – undetected Selenium Feb 15 '18 at 07:52
  • @DebanjanB no, that method did not help me – user9317883 Feb 15 '18 at 08:02

1 Answers1

0

Use below code:

System.setProperty("webdriver.opera.driver", "C:/src/test/resources/operadriver.exe");
OperaOptions options = new OperaOptions();
options.setBinary(new File("C:/Program Files/Opera/50.0.2762.67/opera.exe"));
options.addArguments("--disable-notifications");
driver = new OperaDriver(options);