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 0b987ec commit b8d1cc7
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
16 changes: 8 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>anhtester.com</groupId>
<artifactId>anhtester-cucumber-testng</artifactId>
<version>1.7.0</version>
<version>1.7.1</version>
<name>TestAutomationFrameworkCucumberTestNG</name>
<url>https://github.com/anhtester/AutomationFrameworkCucumberTestNG</url>

Expand All @@ -19,13 +19,13 @@
<maven-compiler-plugin.version>3.12.1</maven-compiler-plugin.version>

<cucumber.java.version>7.15.0</cucumber.java.version>
<gherkin.version>27.0.0</gherkin.version>
<gherkin.version>28.0.0</gherkin.version>
<cucumber-reporting.version>5.7.5</cucumber-reporting.version>
<selenium.version>4.17.0</selenium.version>
<selenium.version>4.18.1</selenium.version>
<testng.version>7.9.0</testng.version>
<webdrivermanager.version>5.6.3</webdrivermanager.version>
<aspectjweaver.version>1.9.21</aspectjweaver.version>
<log4j.version>3.0.0-beta1</log4j.version>
<aspectjweaver.version>1.9.21.1</aspectjweaver.version>
<log4j.version>2.23.0</log4j.version>
<allure-testng.version>2.25.0</allure-testng.version>
<allure-maven.version>2.12.0</allure-maven.version>
<allure-environment-writer.version>1.0.0</allure-environment-writer.version>
Expand All @@ -40,15 +40,15 @@
<assertj.version>3.24.2</assertj.version>
<monte-screen-recorder.version>0.7.7.0</monte-screen-recorder.version>
<mysql-connector-java.version>8.0.33</mysql-connector-java.version>
<google.zxing.version>3.5.2</google.zxing.version>
<google.zxing.version>3.5.3</google.zxing.version>
<lombok.version>1.18.30</lombok.version>
<google.guava.version>33.0.0-jre</google.guava.version>
<data.supplier.version>1.9.7</data.supplier.version>
<javax.mail.version>1.6.2</javax.mail.version>
<zip.version>1.16</zip.version>
<zip.version>1.17</zip.version>
<jackson.version>2.16.1</jackson.version>
<datafaker.version>2.1.0</datafaker.version>
<telegram.bot.version>7.0.1</telegram.bot.version>
<telegram.bot.version>7.1.0</telegram.bot.version>


<!-- Suite XML path -->
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/anhtester/driver/TargetFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.anhtester.constants.FrameworkConstants;
import com.anhtester.enums.Target;
import com.anhtester.exceptions.TargetNotValidException;
import com.anhtester.helpers.PropertiesHelpers;
import com.anhtester.utils.LogUtils;
import org.openqa.selenium.MutableCapabilities;
import org.openqa.selenium.WebDriver;
Expand All @@ -21,10 +22,13 @@ public WebDriver createInstance() {
Target target = Target.valueOf(FrameworkConstants.TARGET.toUpperCase());
WebDriver webdriver;

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

switch (target) {
case LOCAL:
//Create new driver from Enum setup in BrowserFactory class
webdriver = BrowserFactory.valueOf(FrameworkConstants.BROWSER.toUpperCase()).createDriver();
webdriver = BrowserFactory.valueOf(browserName.toUpperCase()).createDriver();
break;
case REMOTE:
//Create new driver on Cloud (Selenium Grid, Docker) from method below
Expand Down
14 changes: 6 additions & 8 deletions src/main/java/com/anhtester/helpers/PropertiesHelpers.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static Properties loadAllFiles() {
LogUtils.info(properties);
return properties;
} catch (IOException e) {
LogUtils.info("Warning !! Can not Load All File.");
LogUtils.warn("Warning !! Can not Load All File.");
return new Properties();
}
}
Expand All @@ -61,6 +61,7 @@ public static void setFile(String relPropertiesFilePath) {
properties.load(file);
file.close();
} catch (Exception e) {
LogUtils.warn("Warning !! Can not set Properties file.");
e.printStackTrace();
}
}
Expand All @@ -73,6 +74,7 @@ public static void setDefaultFile() {
properties.load(file);
file.close();
} catch (Exception e) {
LogUtils.warn("Warning !! Can not set Default Properties file.");
e.printStackTrace();
}
}
Expand All @@ -81,13 +83,9 @@ public static String getValue(String key) {
String keyValue = null;
try {
if (file == null && properties == null) {
properties = new Properties();
linkFile = Helpers.getCurrentDir() + relPropertiesFilePathDefault;
file = new FileInputStream(linkFile);
properties.load(file);
file.close();
setDefaultFile();
}
// Lấy giá trị từ file đã Set

keyValue = properties.getProperty(key);
return LanguageUtils.convertCharset_ISO_8859_1_To_UTF8(keyValue);
} catch (Exception e) {
Expand All @@ -105,7 +103,7 @@ public static void setValue(String key, String keyValue) {
file.close();
out = new FileOutputStream(Helpers.getCurrentDir() + relPropertiesFilePathDefault);
}
//Ghi vào cùng file Prop với file lấy ra

out = new FileOutputStream(linkFile);
System.out.println(linkFile);
properties.setProperty(key, keyValue);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/anhtester/keywords/WebUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.devtools.DevTools;
import org.openqa.selenium.devtools.HasDevTools;
import org.openqa.selenium.devtools.v121.network.Network;
import org.openqa.selenium.devtools.v121.network.model.Headers;
import org.openqa.selenium.devtools.v122.network.Network;
import org.openqa.selenium.devtools.v122.network.model.Headers;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.print.PrintOptions;
import org.openqa.selenium.support.ui.ExpectedCondition;
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/config/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ BROWSER = chrome
# target execution: local or remote
TARGET = local
# headless mode only for chrome or firefox and local execution
HEADLESS = true
HEADLESS = false
URL_CRM = https://rise.fairsketch.com/signin
# grid url and port
REMOTE_URL = localhost
Expand Down

0 comments on commit b8d1cc7

Please sign in to comment.