Skip to content

Commit

Permalink
Update Selenium 4.18.1
Browse files Browse the repository at this point in the history
  • Loading branch information
anhtester committed Feb 25, 2024
1 parent 925186c commit 7845ba8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@
<configuration>
<suiteXmlFiles>
<!--<suiteXmlFile>${suite.all}</suiteXmlFile>-->
<suiteXmlFile>src/test/resources/suites/BuildApp.xml</suiteXmlFile>
<suiteXmlFile>src/test/resources/suites/CMS/LoginTestCMS.xml</suiteXmlFile>
</suiteXmlFiles>
<argLine>
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectjweaver.version}/aspectjweaver-${aspectjweaver.version}.jar"
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/com/anhtester/driver/TargetFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,17 @@ public WebDriver createInstance(String browser) {
Target target = Target.valueOf(FrameworkConstants.TARGET.toUpperCase());
WebDriver webdriver;

String browserName = System.getProperty("browser") != null ? System.getProperty("browser")
: browser;

switch (target) {
case LOCAL:
//Create new driver from Enum setup in BrowserFactory class
webdriver = BrowserFactory.valueOf(browser.toUpperCase()).createDriver();
webdriver = BrowserFactory.valueOf(browserName.toUpperCase()).createDriver();
break;
case REMOTE:
//Create new driver on Cloud (Selenium Grid, Docker) from method below
webdriver = createRemoteInstance(BrowserFactory.valueOf(browser.toUpperCase()).getOptions());
webdriver = createRemoteInstance(BrowserFactory.valueOf(browserName.toUpperCase()).getOptions());
break;
default:
throw new TargetNotValidException(target.toString());
Expand Down

0 comments on commit 7845ba8

Please sign in to comment.