• 渗透测试流程 at 2022年06月18日

    渗透测试在安全测试最难的。属于黑盒测试。

  • 学习了~~

  • 今年是不是找工作很难 at 2022年06月16日

    最近几年一年比一年难~

  • subprocess.call("adb -s {} install {}".format(device_id, path), shell=True)

  • 直播什么时候开始?

  • 记一次静态代码扫描实践 at 2022年02月08日

    图挂掉啦,可以帮忙修复下吗?

  • 我也遇到了,有解决吗?

  • @seveniruby 大神,测试大会上说要发布 appcrawler 2.6 的,什么时候可以发布呀?

  • @dongcx @among29 ,· 8 楼 · February 16, 2017

    #7 楼 @dongcx 不是你代码里面的。
    是右上角的那个,新建并选中一个 environment。
    这个 environment 里面是怎么写 key 和 value 的值的?

  • 我知道我的问题了。jar 包不能直接运行在盘的根目录下。

  • 手机已经安装了 apk,然后运行就出现这种问题,请问是什么原因呢?

  • @chenhengjie123 感觉 wait 是有些问题,但还不知道怎么改
    @tbya 延长时间没有用,那个元素也只会显示 5s,5s 后就不显示了
    @pighero001
    1、如你所说,确实要修改,还不知道怎么修改
    2、隐式等待也是概率性可以
    3、我改下标题吧

  • @yxgtianya 没遇到过。刚学 appium 没多久。你在上面情况下,是怎么处理的?

  • @chenhengjie123看来没有其他办法了,但还是非常感谢你的回答!

  • @chenhengjie123不知道我上面做的对不对。还是没有解决,请大家帮忙支个招~

  • 添加代码:

    System.out.println(driver.getPageSource());//打印整个页面的元素
    

    以下为 log,但好像没有 “设终点” 的内容。(PS:新人,很多不了解)

    <?xml version="1.0" encoding="UTF-8"?><hierarchy rotation="0"><android.widget.FrameLayout index="0" text="" class="android.widget.FrameLayout" package="com.autonavi.xmgd.navigator" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,0][1080,1776]" resource-id="" instance="0"><android.widget.LinearLayout index="0" text="" class="android.widget.LinearLayout" package="com.autonavi.xmgd.navigator" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,0][1080,1776]" resource-id="" instance="0"><android.widget.FrameLayout index="0" text="" class="android.widget.FrameLayout" package="com.autonavi.xmgd.navigator" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,75][1080,1776]" resource-id="android:id/content" instance="1"><android.widget.RelativeLayout index="0" text="" class="android.widget.RelativeLayout" package="com.autonavi.xmgd.navigator" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,75][1080,1776]" resource-id="com.autonavi.xmgd.navigator:id/layout_map_info_id" instance="0"><android.widget.FrameLayout index="0" text="" class="android.widget.FrameLayout" package="com.autonavi.xmgd.navigator" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,75][1080,219]" resource-id="com.autonavi.xmgd.navigator:id/map_showmap_title" instance="2"><android.widget.RelativeLayout index="0" text="" class="android.widget.RelativeLayout" package="com.autonavi.xmgd.navigator" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,75][1080,219]" resource-id="" instance="1"><android.widget.ImageButton NAF="true" index="0" text="" class="android.widget.ImageButton" package="com.autonavi.xmgd.navigator" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,75][126,219]" resource-id="com.autonavi.xmgd.navigator:id/gdtitle_left" instance="0"/><android.widget.TextView index="1" text="请选择终点" class="android.widget.TextView" package="com.autonavi.xmgd.navigator" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[126,106][954,187]" resource-id="com.autonavi.xmgd.navigator:id/gdtitle_text" instance="0"/></android.widget.RelativeLayout><android.widget.RelativeLayout index="1" text="" class="android.widget.RelativeLayout" package="com.autonavi.xmgd.navigator" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,75][1080,219]" resource-id="" instance="2"><android.widget.ImageButton NAF="true" index="0" text="" class="android.widget.ImageButton" package="com.autonavi.xmgd.navigator" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[0,75][126,219]" resource-id="com.autonavi.xmgd.navigator:id/gdtitle_left" instance="1"/><android.widget.TextView index="1" text="" class="android.widget.TextView" package="com.autonavi.xmgd.navigator" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[126,106][954,187]" resource-id="com.autonavi.xmgd.navigator:id/gdtitle_text" instance="1"/></android.widget.RelativeLayout></android.widget.FrameLayout><android.widget.ImageButton NAF="true" index="1" text="" class="android.widget.ImageButton" package="com.autonavi.xmgd.navigator" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[900,234][1065,399]" resource-id="com.autonavi.xmgd.navigator:id/map_tmc" instance="2"/><android.widget.RelativeLayout index="2" text="" class="android.widget.RelativeLayout" package="com.autonavi.xmgd.navigator" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[900,429][1065,594]" resource-id="com.autonavi.xmgd.navigator:id/map_maplayerdrawer_out" instance="3"><android.widget.ImageButton index="0" text="" class="android.widget.ImageButton" package="com.autonavi.xmgd.navigator" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[900,429][1065,594]" resource-id="com.autonavi.xmgd.navigator:id/map_maplayerdrawer" instance="3"/></android.widget.RelativeLayout><android.widget.LinearLayout index="3" text="" class="android.widget.LinearLayout" package="com.autonavi.xmgd.navigator" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[900,1166][1065,1511]" resource-id="com.autonavi.xmgd.navigator:id/map_zoom" instance="1"><android.widget.LinearLayout index="0" text="" class="android.widget.LinearLayout" package="com.autonavi.xmgd.navigator" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[900,1166][1065,1511]" resource-id="" instance="2"><android.widget.ImageView NAF="true" index="0" text="" class="android.widget.ImageView" package="com.autonavi.xmgd.navigator" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[900,1166][1065,1331]" resource-id="com.autonavi.xmgd.navigator:id/plus_id" instance="0"/><android.widget.ImageView NAF="true" index="1" text="" class="android.widget.ImageView" package="com.autonavi.xmgd.navigator" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[900,1346][1065,1511]" resource-id="com.autonavi.xmgd.navigator:id/sub_id" instance="1"/></android.widget.LinearLayout></android.widget.LinearLayout><android.widget.TextView index="4" text="500m" class="android.widget.TextView" package="com.autonavi.xmgd.navigator" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[903,1514][1077,1578]" resource-id="com.autonavi.xmgd.navigator:id/map_scale_level" instance="2"/><android.widget.LinearLayout index="5" text="" class="android.widget.LinearLayout" package="com.autonavi.xmgd.navigator" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[15,1596][1065,1761]" resource-id="com.autonavi.xmgd.navigator:id/map_showmap_toolbar" instance="3"><android.widget.Button index="0" text="上一个点" class="android.widget.Button" package="com.autonavi.xmgd.navigator" content-desc="" checkable="false" checked="false" clickable="true" enabled="false" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[15,1596][540,1761]" resource-id="com.autonavi.xmgd.navigator:id/map_showmap_pre" instance="0"/><android.widget.Button index="1" text="下一个点" class="android.widget.Button" package="com.autonavi.xmgd.navigator" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" bounds="[540,1596][1065,1761]" resource-id="com.autonavi.xmgd.navigator:id/map_showmap_next" instance="1"/></android.widget.LinearLayout></android.widget.RelativeLayout></android.widget.FrameLayout></android.widget.LinearLayout></android.widget.FrameLayout></hierarchy>
    
  • 在上图的界面下运行:

    Set<String> contextNames = driver.getContextHandles();
    for (String contextName : contextNames) {
      System.out.println(contextName); // 用于返回被测app是NATIVE_APP还是WEBVIEW,如果两者都有就是混合型App
    }
    

    得到的打印结果是:
    NATIVE_APP

    应该不是 webview。