lundi 2 mars 2020

How to find whether "PDF" is opened or not using Appium?

I'm running my test scripts on Chrome browser in Android real device (SauceLabs). And my web application used to download PDF file in all the flow.

Sometimes PDF automatically opened in any of the PDF editor installed in the mobile and sometimes PDF is not getting opened (Just download). The problem is I need to fill one more form in the webapplication. If PDF application gets opened automatically the Browser elements are not accessible and testScripts are getting failed.

So I need to find out whether PDF application opened or not.

If (PDF opened){
  driver.context("NATIVE_APP");
 driver.navigate().back();
}else{
 do nothing
  }

Thanks in advance

Aucun commentaire:

Enregistrer un commentaire