Reputation: 11
I have created a class file to print a message. I also configured TestNG xml to execute the class. Below is the contents of the XML file:
<?xml version="1.0" encoding="UTF-8"?>
<suite name="Sample test Suite">
<test name="Sample test">
<classes>
<class name="signIn.MainMenu" />
</classes>
</test>
</suite>
Here is my source code of MainMenu.java:
package signIn;
public class MainMenu {
public static void main(String args[]){
System.out.println("message");
}
}
Can someone help please?
Upvotes: 1
Views: 1085
Reputation: 6939
You need to define a Test via annotations first,
so try this source instead:
import org.testng.annotations.Test;
public class MainMenu {
@Test
public void test(){
System.out.println("message");
}
}
and most important advice of all:
READ a tutorial on how to test with testNG!!
Upvotes: 2