jeudi 19 novembre 2020

I am facing problem in this code. @TestBefore annotation is not working properly and shows error

I am facing problem in this code. @TestBefore annotation is not working properly and shows error FAILED CONFIGURATION: @BeforeTest launchBrowser java.lang.NoSuchMethodError: org.openqa.selenium.os.CommandLine.findExecutable(Ljava/lang/String;)Ljava/lang/String;

public class test1 { public String baseUrl = "https://ift.tt/3nIIQq6"; String driverPath ="C:\Users\Dell\Desktop\selenium\chromedriver_win32\chromedriver.exe"; public WebDriver driver;

@BeforeTest
public void launchBrowser() {
    System.setProperty("webdriver.chrome.driver",driverPath);
    WebDriver driver = new ChromeDriver();
    driver.manage().window().maximize();
    driver.get(baseUrl);
}
@AfterTest
public void terminatebrowser() {
    driver.close();
}

Aucun commentaire:

Enregistrer un commentaire