• #10 楼 @luis js.executeScript 参数只有两个呢?怎么确定 selendroid 当前版本呢?

  • appium-0.16.0 好像已经修改了。

    Selendroid

    remove requirement to manually update selendroid test apk path in test code
    update selendroid (with maven 3.1.1 requirement)

  • #19 楼 @luis
    在这个模式下奇怪的报错。。。。

    File classpathRoot = new File(System.getProperty("user.dir"));
         File appDir = new File(classpathRoot, "../../../apps/meoa");
         File app = new File(appDir, "OldMeoa_debug.apk");
          DesiredCapabilities capabilities = new DesiredCapabilities();
         //capabilities.setCapability("device","Android");
          capabilities.setCapability("device","Selendroid");
          capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
          capabilities.setCapability(CapabilityType.VERSION, "4.0");
          capabilities.setCapability(CapabilityType.PLATFORM, "WINDOWS");
          capabilities.setCapability("app", app.getAbsolutePath());
          capabilities.setCapability("app-package", "com.paic.mobileoa");
          capabilities.setCapability("app-activity", ".LoadingActivity");
          URL url = new URL("http://127.0.0.1:4723/wd/hub");
         remoteWebDriver = new RemoteWebDriver(url, capabilities);
    
    error: Failed to start an Appium session, err was: Error: Waited 20 secs for selendroid serv
    er and it never showed up
    info: Responding to client with error: {"status":33,"value":{"message":"A new session could
    not be created. (Original error: Waited 20 secs for selendroid server and it never showed up
    )","origValue":"Waited 20 secs for selendroid server and it never showed up"},"sessionId":nu
    ll}
    POST /wd/hub/session 500 39197ms - 268b
    
    
  • #17 楼 @luis 老大,现在用 selendorid 模式测 webview,被测 app 有(动态验证码以及手机短信验证码),现在问题有
    1。这种模式下页面元素获取不到(之前用过淘宝的 athrun 可以获取)

    debug: Request received with params: {"using":"name","value":"提交"}
    debug: Proxying command to localhost:8080
    info: Making http request with opts: {"url":"http://localhost:8080/wd/hub/session/211af7fa-f
    783-4437-93ed-0afa092ba21c/element","method":"POST","json":{"using":"name","value":"提交"}}
    info: Responding to client with error: {"status":7,"value":{"message":"An element could not
    be located on the page using the given search parameters.","origValue":"Element was not foun
    d."},"sessionId":"211af7fa-f783-4437-93ed-0afa092ba21c"}
    POST /wd/hub/session/211af7fa-f783-4437-93ed-0afa092ba21c/element 500 5105ms - 229b
    debug: Appium request initiated at /wd/hub/session/211af7fa-f783-4437-93ed-0afa092ba21c
    

    2。不知道怎么跳过动态码的验证。

  • #15 楼 @luis
    自动 check 么?就是没有后门开。。诶。。。
    老大,有 selendroid 下能跑通的 demo 么。我这边无论怎样都不行,我拿过来研究研究

  • #13 楼 @luis 那每次都要重新安装 app 么?程序里有动态吗验证的那就不行了哦?

  • #11 楼 @lihuazhang 恩,谢谢。现在用 selendroid 不能注释路径。Android 又找不到元素。

  • #9 楼 @lihuazhang
    我在https://groups.google.com/forum/#! topic/appium-discuss/vUIqIPdjxvc看到
    Jonathan Lipps 说
    If you want to use webviews, you need to use selendroid mode.所以想确认下。
    大神求帮助啊,我的 webview 一直跑不起来。

  • #7 楼 @luis
    Hi,我昨天试了下,用 Selendroid。加了 aapt.exe 等三个文件可以运行。可以却出现如下问题:
    1..之前用"device","Android"时,第一次运行完后注释 app 的路径。之后会去手机里面找。但是在 selendroid 模式下会报 app 路径找不到的错。改回 Android,就可以。

    error: Failed to start an Appium session, err was: No app set; either start appium with --ap
    p or pass in an 'app' value in desired capabilities
    info: Responding to client with error: {"status":33,"value":{"message":"A new session could
    not be created.","origValue":"No app set; either start appium with --app or pass in an 'app'
     value in desired capabilities"},"sessionId":null}
    POST /wd/hub/session 500 7ms - 223b
    

    2.如果给 Selendroid 加上路径后运行报

    debug: Request received with params: {"name":"WEBVIEW"}
    debug: Proxying command to localhost:8080
    info: Making http request with opts: {"url":"http://localhost:8080/wd/hub/session/6800894c-8
    423-4018-b5b1-fa0a042e973c/window","method":"POST","json":{"name":"WEBVIEW"}}
    debug: Proxied response received with status 500: undefined
    POST /wd/hub/session/6800894c-8423-4018-b5b1-fa0a042e973c/window 500 5204ms
    

    请问一下,appium 测试 webview 只能用 Selendroid 模式么。
    谢谢~

  • #5 楼 @luis 恩。我看过这个帖子了,方法我也根据http://stackoverflow.com/questions/16619143/android-maven-could-not-find-tool-aapt所说改了还是有问题。晚上回去在研究研究

  • #3 楼 @luis 这是因为改成 capabilities.setCapability("device","Selendroid") 后的问题。后面加上了路径,报 err was: Error: Could not find aapt in tools。
    之前第一次 Ok 了就把路径注释了的

  • #1 楼 @benlooking 改成 capabilities.setCapability("device","Selendroid");后根据
    http://stackoverflow.com/questions/16619143/android-maven-could-not-find-tool-aapt 所说
    修改 windows 版本的 mklink aapt.exe ..\build-tools\android-4.2.2\aapt.exe mklink /D lib ..\build-tools\android-4.2.2\lib mklink aidl.exe ..\build-tools\android-4.2.2\aidl.exe 也继续报错
    Failed to start an Appium session, err was: Error: Could not find aapt in tools

  • capabilities.setCapability("device","Android") 换成 capabilities.setCapability("device","Selendroid");
    也是问题》

    debug: Appium request initiated at /wd/hub/session
    debug: Request received with params: {"desiredCapabilities":{"platform":"WINDOWS","browserNa
    me":"","app-package":"com.paic.mobileoa","device":"selendroid","app-activity":".LoadingActiv
    ity"}}
    info: Got configuration error, not starting session
    info: Cleaning up appium session
    error: Failed to start an Appium session, err was: No app set; either start appium with --ap
    p or pass in an 'app' value in desired capabilities
    info: Responding to client with error: {"status":33,"value":{"message":"A new session could
    not be created.","origValue":"No app set; either start appium with --app or pass in an 'app'
     value in desired capabilities"},"sessionId":null}
    POST /wd/hub/session 500 8ms - 223b
    
  • 请问这个问题解决了么?
    我现在一直卡在这个问题上了。。。

    info: Responding to client with success: {"status":0,"value":{"platform":"WINDOWS","browserN
    ame":"","version":"4.2","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled"
    :true,"databaseEnabled":false,"app-package":"com.paic.mobileoa","device":"Android","app-acti
    vity":".LoadingActivity"},"sessionId":"48a55fd2-d6f6-4f5d-b225-1567b1c402bd"}
    GET /wd/hub/session/48a55fd2-d6f6-4f5d-b225-1567b1c402bd 200 4ms - 388b
    debug: Appium request initiated at /wd/hub/session/48a55fd2-d6f6-4f5d-b225-1567b1c402bd/wind
    ow
    debug: Request received with params: {"name":"WEBVIEW"}
    info: Responding to client that a method is not implemented
    POST /wd/hub/session/48a55fd2-d6f6-4f5d-b225-1567b1c402bd/window 501 8ms - 180b
    
  • #19 楼 @lihuazhang
    你好,appium 运行的时候能够不重新加载 apk 么? 我现在想每次运行都是我手机里面的 apk。
    而不是通过代码里面的那个重新加载。

    File appDir = new File(classpathRoot, "../../../apps/meoa");
    File app = new File(appDir, "OldMeoa_debug.apk");

  • #19 楼 @lihuazhang 解决问题了。。是因为 adb 权限不够。。。今天麻烦了哈,非常感谢。

  • #19 楼 @lihuazhang
    这里面也有。

  • #19 楼 @lihuazhang 我好像是没有这个 jar 包?

  • #16 楼 @lihuazhang
    额。不好意思,发现没有 uiautomator.odex 那个

  • #14 楼 @lihuazhang
    没有额。。

  • #12 楼 @lihuazhang 请问要怎么看呢?adb shell??

  • #9 楼 @lihuazhang 4.2.2 的系统。

  • #7 楼 @lihuazhang 恩。。那请问解决办法是什么呢?

  • #5 楼 @lihuazhang 也就是说 windows 的环境变量么。那个设置过了的。现在是用模拟器是可以跑,真机不行。我在想是不是 4724 端口找不到的原因呢