Sometimes JUnit or TestNG annotations gives syntax error eventhough we have imported all the necessary packages. It gives the error "Syntax error, annotations are only available if source level is 5.0". When you hover at the annotations, you will be able to see this error.
Actually nothing wrong with your JUnit or TestNG packages/jars. This is something to do with your Eclipse setup. This will happen if you have JDK 1.3 or 1.4 installed or configured with your Eclipse. If you have JDK 1.5 or 1.6 installed/configured you can fix this issue. Make sure which version of JDK has been installed/configured.
Follow these steps to get this issue fixed.
1) Eclipse > Window Menu > Preferences - Expand Java - Select Compiler - Check the version of JDK Compilance level.
2) If you see JDK 1.3 or 1.4, select JDK 1.5. or 1.6 for all the options and click on Apply.
Actually nothing wrong with your JUnit or TestNG packages/jars. This is something to do with your Eclipse setup. This will happen if you have JDK 1.3 or 1.4 installed or configured with your Eclipse. If you have JDK 1.5 or 1.6 installed/configured you can fix this issue. Make sure which version of JDK has been installed/configured.
Follow these steps to get this issue fixed.
1) Eclipse > Window Menu > Preferences - Expand Java - Select Compiler - Check the version of JDK Compilance level.
2) If you see JDK 1.3 or 1.4, select JDK 1.5. or 1.6 for all the options and click on Apply.
SWIFT Interview questions on
ReplyDeletehttp://testwithus.blogspot.in/p/swift.htm
For selenium solution visit
http://testwithus.blogspot.in/p/blog-page.html
Thanks for the great information in your blog Selenium Training
ReplyDelete