Murp01 / FatBottomedFramework

Working from course testing WebdriverUniversity Website
0 stars 0 forks source link

Java error when running test-ng .xml #3

Closed Murp01 closed 5 years ago

Murp01 commented 5 years ago

The following error appears when running the test-ng .xml file.

image

image

image

Murp01 commented 5 years ago

Try cleaning the project

Murp01 commented 5 years ago

Maybe try changing jdk version - changed to 9 and 10 and the followiing exception occurs when runnign .xml. Other tests run for the record

image

Murp01 commented 5 years ago

Short answer: Right click on the class that contains the main method. Click on "Run As". Click on "Java Application". The keyboard shortcut is: Shift+Alt+X J (while holding Shift and Alt, press X; then release Shift and Alt and press J).

Long answer: To be honest, I am not 100% sure why this problem happens. It might be because of using a different jdk. I faced the same error. The solution was easier than what I imagined. I was used to running my code using Ctrl + F11. But when I ran it as a java application (the way I described in "short answer"), the problem

Murp01 commented 5 years ago

Downloaded project from course and the same error appears. Must be my environment config.

Murp01 commented 5 years ago

Deleted the username/.m2 file directory and updated the project to resolve this.

Also, the testng xml had the testrunner title proceeded by the file extention (runners.MainRunner.java). Removed .java as I was getting can not find class when running the test.