0

Code trials:

@BeforeMethod
public void setUp() {
     System.setProperty("webdriver.chrome.driver", "C:/Users/hp/Downloads/chromedriver_win32/chromedriver.exe");
        driver = new ChromeDriver();
        //driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
        driver.manage().window().maximize();
        driver.get("https://www.google.com");
}

@Test

public void verifyTitle() {
    System.out.println("demo");
    String title =driver.getTitle();
    System.out.println("the page title is :"+title);
    Assert.assertEquals(title,"Google");    
}

@AfterMethod
public void tearDown() {
    driver.quit();
}

This is the code I am trying to run using Selenium Testng but showing error as Test case not found

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • Update the question with entire error stack trace. – cruisepandey Mar 23 '22 at 13:07
  • Also how you are running your test, using testng.xml Are you getting this option run as testng test for this class in your code ? Also check testng plugin is installed or not – Amit Jain Mar 23 '22 at 13:09

1 Answers1

0

As you are using TestNG you need to add the following import:

import org.testng.annotations.Test;
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352