Maven Debugger in IntelliJ for Automated tests
Dinu Vijayan
?? Automation Test Lead | Senior Automation Engineer | ISTQB Certified ?? 12+ Years in Test Automation | Selenium | API Testing | CI/CD | Playwright | Java & JavaScript
We often run our tests using Maven command line arguments, but while debugging people usually follows IDE debug options instead of maven debug options. The maven command with clean option clears all generated class files and it doesn’t have any cache as in IDE execution so I usually prefer executions using maven command line. Given below are steps to help you debug a test script using maven command line.
1.?????? Open IntelliJ IDE, go to Menu > Run> ?Edit configurations
2. Click on “+” sign to add a new configuration
3. Select Remote JVM Debug
4. Give some meaningful name and edit the port to 8000 or any port number which you prefer
5. Click “Apply” button followed by “OK” button.
6. Add break point in the test case which you desire to debug
7. Open terminal and enter the command mvnDebug clean test -Dgroups=<groupName>
8. Add breakpoints and then Click debug symbol in IDE to start the execution in debug mode from Maven