Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8980869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:11:36+00:00 2026-06-15T20:11:36+00:00

On using TestNG with Java, i get the following error: ‘Type mismatch: cannot convert

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T20:11:37+00:00Added an answer on June 15, 2026 at 8:11 pm

    Though import org.testng.annotations.*;
    imports everything, it did not work.
    But when I imported only the required classes it worked fine.

    BEFORE:

    import org.testng.annotations.*;  
    

    which did not work

    AFTER:

    import org.testng.annotations.BeforeTest;   
    import org.testng.annotations.Test;   
    import org.testng.annotations.AfterTest;
    

    which worked

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the following test runner: http://code.google.com/p/migen/source/browse/trunk/java/src/uk/ac/lkl/common/util/testing/LabelledParameterized.java?r=3789 What it does is change the
I'm using Selenium WebDriver with Testng (started using an .xml file) to test a
I am using selenium rc in eclipse with testNG. I need to click on
I get the following error when running a build from jenkins: I have narrowed
I have defined the following Unit-Test: [TestMethod] //@Test for the Java crowd public void
Using Eclipse 3.6.1 Java 1.6.0_26 JMockit 0.999.10 UPDATE: I was able to create a
Is there a way to catch a connection error when using pelops in Java?
I am trying to get the GPS location of my G1 using the following
The following code is a test program that creates an xlsx blob using Apache
I'm trying to run Selenium tests with Selenium-RC using TestNG on Eclipse. When I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.