File tree Expand file tree Collapse file tree 5 files changed +65
-1
lines changed Expand file tree Collapse file tree 5 files changed +65
-1
lines changed Original file line number Diff line number Diff line change 55import aquality .selenium .core .localization .ILocalizedLogger ;
66import aquality .selenium .core .utilities .IActionRetrier ;
77import org .openqa .selenium .chrome .ChromeDriver ;
8+ import org .openqa .selenium .chrome .ChromeDriverService ;
89import org .openqa .selenium .chrome .ChromeOptions ;
910import org .openqa .selenium .edge .EdgeDriver ;
1011import org .openqa .selenium .edge .EdgeOptions ;
@@ -32,9 +33,13 @@ protected RemoteWebDriver getDriver() {
3233 IDriverSettings driverSettings = browserProfile .getDriverSettings ();
3334 switch (browserName ) {
3435 case CHROME :
35- case YANDEX :
3636 driver = new ChromeDriver ((ChromeOptions ) driverSettings .getDriverOptions ());
3737 break ;
38+ case YANDEX :
39+ case OPERA :
40+ driver = new ChromeDriver (new ChromeDriverService .Builder ().withBuildCheckDisabled (true ).build (),
41+ (ChromeOptions ) driverSettings .getDriverOptions ());
42+ break ;
3843 case FIREFOX :
3944 driver = new FirefoxDriver ((FirefoxOptions ) driverSettings .getDriverOptions ());
4045 break ;
Original file line number Diff line number Diff line change @@ -52,6 +52,9 @@ public IDriverSettings getDriverSettings() {
5252 case SAFARI :
5353 driverSettings = new SafariSettings (settingsFile );
5454 break ;
55+ case OPERA :
56+ driverSettings = new OperaSettings (settingsFile );
57+ break ;
5558 case YANDEX :
5659 driverSettings = new YandexSettings (settingsFile );
5760 break ;
Original file line number Diff line number Diff line change 1+ package aquality .selenium .configuration .driversettings ;
2+
3+ import aquality .selenium .browser .BrowserName ;
4+ import aquality .selenium .core .utilities .ISettingsFile ;
5+ import org .openqa .selenium .chrome .ChromeOptions ;
6+ import org .openqa .selenium .remote .AbstractDriverOptions ;
7+
8+ public class OperaSettings extends ChromeSettings {
9+ private static final String DEFAULT_BINARY_LOCATION = "%USERPROFILE%\\ AppData\\ Local\\ Programs\\ Opera\\ launcher.exe" ;
10+ public OperaSettings (ISettingsFile settingsFile ) {
11+ super (settingsFile );
12+ }
13+
14+ @ Override
15+ public AbstractDriverOptions <?> getDriverOptions () {
16+ ChromeOptions options = (ChromeOptions ) super .getDriverOptions ();
17+ options .setExperimentalOption ("w3c" , true );
18+ options .setBinary (getBinaryLocation (DEFAULT_BINARY_LOCATION ));
19+ return options ;
20+ }
21+
22+ @ Override
23+ public BrowserName getBrowserName () {
24+ return BrowserName .OPERA ;
25+ }
26+ }
Original file line number Diff line number Diff line change 6666 "safari" : {
6767 "downloadDir" : " /Users/username/Downloads"
6868 },
69+ "opera" : {
70+ "binaryLocation" : " %USERPROFILE%\\ AppData\\ Local\\ Programs\\ Opera\\ launcher.exe" ,
71+ "capabilities" : {
72+ "unhandledPromptBehavior" : " ignore"
73+ },
74+ "options" : {
75+ "intl.accept_languages" : " en" ,
76+ "safebrowsing.enabled" : " true" ,
77+ "profile.default_content_settings.popups" : " 0" ,
78+ "disable-popup-blocking" : " true" ,
79+ "download.prompt_for_download" : " false" ,
80+ "download.default_directory" : " ./downloads"
81+ },
82+ "startArguments" : [ " --remote-debugging-port=9222" , " --no-sandbox" , " --disable-dev-shm-usage" ]
83+ },
6984 "yandex" : {
7085 "binaryLocation" : " %USERPROFILE%\\ AppData\\ Local\\ Yandex\\ YandexBrowser\\ Application\\ browser.exe" ,
7186 "capabilities" : {
Original file line number Diff line number Diff line change 6565 "safari" : {
6666 "downloadDir" : " /Users/username/Downloads"
6767 },
68+ "opera" : {
69+ "binaryLocation" : " %USERPROFILE%\\ AppData\\ Local\\ Programs\\ Opera\\ launcher.exe" ,
70+ "capabilities" : {
71+ "unhandledPromptBehavior" : " ignore"
72+ },
73+ "options" : {
74+ "intl.accept_languages" : " en" ,
75+ "safebrowsing.enabled" : " true" ,
76+ "profile.default_content_settings.popups" : " 0" ,
77+ "disable-popup-blocking" : " true" ,
78+ "download.prompt_for_download" : " false" ,
79+ "download.default_directory" : " ./downloads"
80+ },
81+ "startArguments" : [ " --remote-debugging-port=9222" , " --no-sandbox" , " --disable-dev-shm-usage" ]
82+ },
6883 "yandex" : {
6984 "binaryLocation" : " %USERPROFILE%\\ AppData\\ Local\\ Yandex\\ YandexBrowser\\ Application\\ browser.exe" ,
7085 "capabilities" : {
You can’t perform that action at this time.
0 commit comments