Test Automation using Selenium on Java Maven
Sample Test Automation
Test Automation using Selenium on Java Maven

Image Credit to Engin_Aykurt
On my previous article, I show sample Test Automation on Java Maven using Playwright Library.
On this article, I will use Selenium Library. The legendary popular library since the dawn of Test Automation.
Here is my GitHub Repository for it: https://github.com/ahmadazerichandrabhuana/javamavenselenium
Just download it or copy it, it’s free 😄
As usual, before you download / clone it, here are the requirements need to be fulfilled first.
Requirements
Requirement 1 : Install Java, setup JAVA_HOME, and setup MAVEN_HOME
For setting up JAVA_HOME manually, you can refer to my article here:
[embed]Setting up JAVA_HOME Guideline for Windows, MacOS, and Ubuntumedium.com
For setting up MAVEN_HOME manually, you can refer to my article here:
[embed]Install Maven by setting up MAVEN_HOME Guideline for Windows, MacOS, and Ubuntumedium.com
But, I’ll personally suggest to use SDKMAN! since it would be much easier for handling anything Java-related using this single tool. Check the reference for SDKMAN! on my article here:
Requirement 2 : IDE or Code Editor
Install any IDE or Code Editor you’re most comfort with. For IDE, I’ll suggest to use IntelliJ IDEA since this is a Java-based project. If you prefer to use Code Editor, I’ll suggest to use VS Code.
Requirement 3 : Install Allure Report
Check Allure Report’s Official Website. There is already instruction for Windows, MacOS, and Linux.
Verify if the Allure Report is installed correctly by run this command :
allure --version

Run Test
On your IDE / Code Editor’s terminal, run the test using command :
mvn clean test -DtestSuites=testsuites/test.xml

it will open the browser several times and execute test cases listed inside file **test.xml on folder `testsuites`**.

Open Report File
I use Allure Report as per mentioned on the section Requirements above. So, to open the Report File, run these command :
allure serve
or this command also OK :
allure generate --clean && allure open

It will automatically open Allure Report on your default browser :

If you check my previous article, then you might see, how similar actually the implementation between Playwright and Selenium (at least, on execution level shown on this article). And, if you’re interested, you might as well check the code deeper and might found that even though the syntax is different, the concept is actually also pretty similar. Yeah, that’s the beauty of Test Automation framework. The syntax might not be the exact same, but the overall flow are same. Makes us easier to learn each different framework.
Feel free to browse my other articles to deepen you experience related with any Test Automation Framework. Or you can go straight to my GitHub for the code repositories as well.
Thanks for reading this far, and see you on other articles 👋
메타데이터
- post_id
- bb175950a3bf
- slug
- test-automation-using-selenium-on-java-maven-bb175950a3bf
- url
- https://medium.com/@zorozeri/test-automation-using-selenium-on-java-maven-bb175950a3bf
- canonical_url
- https://medium.com/@zorozeri/test-automation-using-selenium-on-java-maven-bb175950a3bf
- author_url
- https://medium.com/@zorozeri
- status
- ok
- fetched_at
- 2026-07-21 06:32:45