how to handle alerts in android using appium

后端 未结 9 1899
野趣味
野趣味 2020-12-11 08:18

How do I handle alerts in an Android web application using Appium server (1.0.1) and the Android SDK?

The below code is not working on android:

drive         


        
9条回答
  •  时光取名叫无心
    2020-12-11 08:25

    Please use the below code, Add some wait before clicking on OK Button. After that pass the xpath of you OK Button.

    synchronized (driver)
    {
    driver.wait(2000);
    }
    driver.context(NATIVE_APP);
    driver.findElementByXPath{("//android.widget.Button[@resourceid=
    ‘android:id/button1’]").click();
    

提交回复
热议问题