On using TestNG with Java, i get the following error:
‘Type mismatch: cannot convert test to Annotation’
Note: Using eclipse IDE.
The build path has the TestNG jar included
Also TestNG plugin for eclipse IDE has been installed.
Could you please tell me why i get the above error?
Thanks
Code:
import org.testng.annotations.*;
public class ChangeResolutionOnMainWatch {
@BeforeTest
public void startTest() throws Exception {
watch.startSelenium();
stream_delay=Integer.parseInt(System.getProperty("stream_delay").trim());
}
@Test
public void launchFalcon()throws Exception{
watch.deleteAllCookie();
watch.launchFalcon();
}
}
In the above piece of code the ‘@Test’ notation gives the error
Though import org.testng.annotations.*;
imports everything, it did not work.
But when I imported only the required classes it worked fine.
BEFORE:
which did not work
AFTER:
which worked