Skip to content

Commit 621c77b

Browse files
committed
added drivermanager
1 parent efe4be8 commit 621c77b

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
This is a very handy reusable maven project that uses Selenium Webdriver and Java.
33

44
### Key Features
5+
- Java documentation
56
- Parallel Execution
67
- Customer Annotation
78
- Cross browser testing
@@ -18,8 +19,11 @@ This is a very handy reusable maven project that uses Selenium Webdriver and Jav
1819
3. In the terminal, Perform "mvn clean test" to execute all tests
1920
```
2021

22+
### View Framework Java Document
23+
- Documents are saved under {PROJECT_ROOT_FOLDER}/javadoc/index.html
24+
2125
### View Report
22-
- Report are saved under {PROJECT_ROOT_FOLDER}/extent-output/datetime_index.html
26+
- Reports are saved under {PROJECT_ROOT_FOLDER}/extent-output/datetime_index.html
2327

2428
### Reports used
2529
- `Spark Report`

pom.xml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
<artifactId>SeleniumAutomationFramework</artifactId>
77
<version>0.0.1-SNAPSHOT</version>
88

9+
<properties>
10+
<maven.compiler.source>1.8</maven.compiler.source>
11+
<maven.compiler.target>1.8</maven.compiler.target>
12+
</properties>
13+
914
<dependencies>
1015
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
1116
<dependency>
@@ -26,13 +31,18 @@
2631
<version>3.18.1</version>
2732
<scope>test</scope>
2833
</dependency>
34+
<!-- https://mvnrepository.com/artifact/io.github.bonigarcia/webdrivermanager -->
35+
<dependency>
36+
<groupId>io.github.bonigarcia</groupId>
37+
<artifactId>webdrivermanager</artifactId>
38+
<version>4.3.1</version>
39+
</dependency>
2940
<!-- https://mvnrepository.com/artifact/com.aventstack/extentreports -->
3041
<dependency>
3142
<groupId>com.aventstack</groupId>
3243
<artifactId>extentreports</artifactId>
3344
<version>5.0.6</version>
3445
</dependency>
35-
3646
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
3747
<dependency>
3848
<groupId>org.apache.poi</groupId>
@@ -57,6 +67,5 @@
5767
<artifactId>jackson-core</artifactId>
5868
<version>2.12.1</version>
5969
</dependency>
60-
6170
</dependencies>
6271
</project>

src/main/java/com/testnepal/driver/Drivers.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
import java.util.Objects;
44

55
import org.openqa.selenium.chrome.ChromeDriver;
6+
import org.openqa.selenium.edge.EdgeDriver;
67
import org.openqa.selenium.firefox.FirefoxDriver;
7-
import org.openqa.selenium.ie.InternetExplorerDriver;
88

9-
import com.testnepal.constants.FrameworkConstant;
109
import com.testnepal.enums.ConfigProperties;
1110
import com.testnepal.utils.PropertyUtils;
1211

12+
import io.github.bonigarcia.wdm.WebDriverManager;
13+
1314
/**
1415
* <p>Driver class is responsible for invoking and closing the browser. </p>
1516
* <p>It is also responsible for setting
@@ -38,14 +39,14 @@ private Drivers() {
3839
public static void initDriver(String browser) {
3940
if(Objects.isNull(DriverManager.getDriver())) {
4041
if(browser.equalsIgnoreCase("chrome")) {
41-
System.setProperty("webdriver.chrome.driver", FrameworkConstant.getChromeDriverPath());
42+
WebDriverManager.chromedriver().setup();
4243
DriverManager.setDriver(new ChromeDriver());
4344
} else if(browser.equalsIgnoreCase("firefox")) {
44-
System.setProperty("webdriver.gecko.driver", FrameworkConstant.getGeckoDriverPath());
45+
WebDriverManager.firefoxdriver().setup();
4546
DriverManager.setDriver(new FirefoxDriver());
4647
} else if(browser.equalsIgnoreCase("edge")) {
47-
System.setProperty("webdriver.ie.driver", FrameworkConstant.getEdgeDriverPath());
48-
DriverManager.setDriver(new InternetExplorerDriver());
48+
WebDriverManager.edgedriver().setup();
49+
DriverManager.setDriver(new EdgeDriver());
4950
}
5051
DriverManager.getDriver().get(PropertyUtils.getValue(ConfigProperties.URL));
5152
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy