mardi 25 décembre 2018

how to get text from alert box in appium?

I wrote the following code but it is showing org.openqa.selenium.WebDriverException: Method has not yet been implemented (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 0 milliseconds

AndroidDriver driver = new AndroidDriver(u,dc);

     driver.manage().timeouts().implicitlyWait(100,TimeUnit.SECONDS);

     WebDriverWait wait = new WebDriverWait(driver,30);

     wait.until(ExpectedConditions.alertIsPresent());
     Alert alert = driver.switchTo().alert();
     alert.accept();
     String t = alert.getText();
     System.out.println(t);

Aucun commentaire:

Enregistrer un commentaire