Not able to identify element in WEBVIEW in iOS hyprid app automation using Appium on real device

后端 未结 3 610
故里飘歌
故里飘歌 2021-01-15 17:45

I was trying to automate the hybrid app build using ionic2/Angular2 and typescript.

I am using C# for code writing. test are in BDD - specflow Versions: iOS:9.3.1 Xc

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-15 18:06

    1) While access ios webview -- using getcontextHandles we can achieve

    Set contextNames = idriver.getContextHandles();

    System.out.println(contextNames);
    
    for (String contextName : contextNames) {
      if (contextName.contains("NATIVE_APP")) {
        Reporter.log("Reaching to Native App", true);
        idriver.context(contextName);
        sleepfor(1000);
        idriver.findElementByName("Open").click();
        Reporter.log("Clicking Open to naviagte to Native APP", true);
      }
      else{
        Reporter.log("Not found", true);
      }
    }
    

    2) If above context doesn't work -- try to run iproxy run this in terminal -- ios_webkit_debug_proxy -c deviceID:27753 -d deviceID -- to get device id (instruments -s devices)

提交回复
热议问题