Skip to content

Commit 5183c8c

Browse files
committed
[master] - support for selenium 3.0.1
1 parent e4ec494 commit 5183c8c

File tree

4 files changed

+25
-6
lines changed

4 files changed

+25
-6
lines changed

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>net.itarray</groupId>
88
<artifactId>automotion</artifactId>
9-
<version>1.2.1</version>
9+
<version>1.3.0</version>
1010
<name>Automotion</name>
1111
<description>Library for automation testing</description>
1212
<url>https://www.itarray.net</url>
@@ -117,17 +117,17 @@
117117
<dependency>
118118
<groupId>org.seleniumhq.selenium</groupId>
119119
<artifactId>selenium-java</artifactId>
120-
<version>2.53.1</version>
120+
<version>3.0.1</version>
121121
</dependency>
122122
<dependency>
123123
<groupId>org.seleniumhq.selenium</groupId>
124124
<artifactId>selenium-server</artifactId>
125-
<version>2.53.1</version>
125+
<version>3.0.1</version>
126126
</dependency>
127127
<dependency>
128128
<groupId>org.seleniumhq.selenium</groupId>
129129
<artifactId>selenium-remote-driver</artifactId>
130-
<version>2.53.1</version>
130+
<version>3.0.1</version>
131131
</dependency>
132132
<dependency>
133133
<groupId>io.appium</groupId>

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This is JAVA library for the running of mobile, web or API automated tests.
88
<dependency>
99
<groupId>net.itarray</groupId>
1010
<artifactId>automotion</artifactId>
11-
<version>1.2.1</version>
11+
<version>1.3.0</version>
1212
</dependency>
1313

1414
### Steps of adding to the project ###
@@ -31,7 +31,7 @@ This is JAVA library for the running of mobile, web or API automated tests.
3131

3232
### Steps of using during test run ###
3333

34-
#### ! Do not forget to put Chrome driver into Your project src/test/resources/drivers ! ####
34+
#### ! Do not forget to put Chrome and Gecko drivers into Your project src/test/resources/drivers ! ####
3535

3636
- Specify env variables or system properties (example):
3737
* For Web local run:

src/main/java/environment/EnvironmentFactory.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ public static boolean isIOS() {
5959
return PLATFORM != null && PLATFORM.toUpperCase().equals("IOS");
6060
}
6161

62+
public static boolean isWindows() {
63+
String PLATFORM = System.getenv(EnvironmentConstants.PLATFORM) != null ? System.getenv(EnvironmentConstants.PLATFORM) : System.getProperty(EnvironmentConstants.PLATFORM);
64+
return PLATFORM != null && PLATFORM.toUpperCase().equals("WINDOWS");
65+
}
66+
6267
public static String getRemoteUrlPath() {
6368
return System.getenv(EnvironmentConstants.EXECUTOR) != null ? System.getenv(EnvironmentConstants.EXECUTOR) : System.getProperty(EnvironmentConstants.EXECUTOR);
6469
}

src/main/java/util/driver/WebDriverFactory.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ private AppiumDriver getMobileDriver() {
7575
} catch (MalformedURLException e) {
7676
e.printStackTrace();
7777
}
78+
} else if (isWindows()) {
79+
try {
80+
appiumDriver = new IOSDriver(new URL(getRemoteUrlPath()), capabilities);
81+
} catch (MalformedURLException e) {
82+
e.printStackTrace();
83+
}
7884
}
7985

8086
return appiumDriver;
@@ -83,6 +89,7 @@ private AppiumDriver getMobileDriver() {
8389
private WebDriver getLocalWebDriver() {
8490
if (isFirefox()) {
8591
webDriver = new FirefoxDriver();
92+
setGeckoDriver();
8693
} else if (isChrome()) {
8794
setChromeDriver();
8895
ChromeOptions options = new ChromeOptions();
@@ -119,6 +126,13 @@ private static void setChromeDriver() {
119126
System.setProperty("webdriver.chrome.driver", chromeBinary);
120127
}
121128

129+
private static void setGeckoDriver() {
130+
Platform platform = Platform.getCurrent();
131+
String geckoBinary = "src/main/resources/drivers/geckodriver"
132+
+ (platform.toString().toUpperCase().contains("WIN") ? ".exe" : "");
133+
System.setProperty("webdriver.gecko.driver", geckoBinary);
134+
}
135+
122136
private static void setIEDriver() {
123137
Platform platform = Platform.getCurrent();
124138
String chromeBinary = "src/main/resources/drivers/IEDriverServer"

0 commit comments

Comments
 (0)