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 5
5
import aquality .selenium .core .localization .ILocalizedLogger ;
6
6
import aquality .selenium .core .utilities .IActionRetrier ;
7
7
import org .openqa .selenium .chrome .ChromeDriver ;
8
+ import org .openqa .selenium .chrome .ChromeDriverService ;
8
9
import org .openqa .selenium .chrome .ChromeOptions ;
9
10
import org .openqa .selenium .edge .EdgeDriver ;
10
11
import org .openqa .selenium .edge .EdgeOptions ;
@@ -32,9 +33,13 @@ protected RemoteWebDriver getDriver() {
32
33
IDriverSettings driverSettings = browserProfile .getDriverSettings ();
33
34
switch (browserName ) {
34
35
case CHROME :
35
- case YANDEX :
36
36
driver = new ChromeDriver ((ChromeOptions ) driverSettings .getDriverOptions ());
37
37
break ;
38
+ case YANDEX :
39
+ case OPERA :
40
+ driver = new ChromeDriver (new ChromeDriverService .Builder ().withBuildCheckDisabled (true ).build (),
41
+ (ChromeOptions ) driverSettings .getDriverOptions ());
42
+ break ;
38
43
case FIREFOX :
39
44
driver = new FirefoxDriver ((FirefoxOptions ) driverSettings .getDriverOptions ());
40
45
break ;
Original file line number Diff line number Diff line change @@ -52,6 +52,9 @@ public IDriverSettings getDriverSettings() {
52
52
case SAFARI :
53
53
driverSettings = new SafariSettings (settingsFile );
54
54
break ;
55
+ case OPERA :
56
+ driverSettings = new OperaSettings (settingsFile );
57
+ break ;
55
58
case YANDEX :
56
59
driverSettings = new YandexSettings (settingsFile );
57
60
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 66
66
"safari" : {
67
67
"downloadDir" : " /Users/username/Downloads"
68
68
},
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
+ },
69
84
"yandex" : {
70
85
"binaryLocation" : " %USERPROFILE%\\ AppData\\ Local\\ Yandex\\ YandexBrowser\\ Application\\ browser.exe" ,
71
86
"capabilities" : {
Original file line number Diff line number Diff line change 65
65
"safari" : {
66
66
"downloadDir" : " /Users/username/Downloads"
67
67
},
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
+ },
68
83
"yandex" : {
69
84
"binaryLocation" : " %USERPROFILE%\\ AppData\\ Local\\ Yandex\\ YandexBrowser\\ Application\\ browser.exe" ,
70
85
"capabilities" : {
You can’t perform that action at this time.
0 commit comments