-
Install JDK 11 or above
-
Install Intellij Community Edition
-
File > New > Project > New Project
Name: YourProjectName Location: Your project location Language: Java Build System: Gradle JDK: Your jdk Gradle DSL: Groovy Add sample code: unchecked
-
Add required dependencies from maven central to build.gradle
-
For example,
implementation('junit:junit:4.13.1') implementation('io.github.bonigarcia:webdrivermanager:5.7.0') implementation('org.seleniumhq.selenium:selenium-java:4.18.1')
-
Load Gradle Changes
-
Add classes under /src/main/java/package
-
The WebDriverManager will download chromedriver automatically in runtime
WebDriverManager.chromedriver().setup();
- Add classes under /src/test/java/package
- Add classes under /src/test/java/package
If you would like to use example codes from this repo, follow these steps:
-
Copy the src directory to yourProject
-
Add the following dependencies to build.gradle
implementation('org.testng:testng:7.0.0') implementation('com.deque.html.axe-core:selenium:4.8.0')
If you would like to parallel run SitesAdminTest, follow this guide:
-
Right-click on the method name in the code editor and select:
- Run testLogin()
-
Click on the method name in the code editor and press the key combination:
- ctrl + shift + F10
- Run
./gradlew clean test --tests SearchTest.testSearchByKeywords