#14 楼 @seveniruby 还是只是终端模拟器啊
#14 楼 @seveniruby 一直有个疑问,请问云测系统,难道真的有机房,里面摆了 N 个真机吗?然后管理平台统一去调度这些终端
可以稍作修改,把 monkey 的随机无序动作,轨迹记录下来,方便问题定位哦
#2 楼 @anonymous1 单点登录,这个木办法啊,只能搞多个账号,你遇到的问题,我们也同样遇到的,比较头疼
我们这边是这么搞的,搞了集群
1、一台 PC 用 USB 连接多台手机终端,每台手机终端都视为 runner
2、有一台集群管理平台,直接控制这些 PC
3、把写好的脚本,如 monkeyrunner、appium、robotium 或者其他脚本上传到这个管理平台上,由这个管理平台把脚本动作复制分发给每个节点的 pc,再有 pc 上的 agent 分发给每个 runner
4、每个节点的 pc 上传 log 到报表 server
不错啊,好 open,感谢感谢
时间总是有的,看你怎么挤啦
#5 楼 @chenhengjie123 可以的,我用过了,完全 ok
#3 楼 @mzl19860128 建议使用 selenium 中 FluentWait 链式调用方式,可以解决此问题
实在不行,你可以让开发,在测试环境中,给你搞个通用码就可以了嘛,而且,你直接写个函数,去库里取出随机码,然后再调用 appium send 进去就 ok 啦
#1 楼 @chenhengjie123 问题解决了,google 一直打不开,get 不会执行,直到超时,谢谢啦
#4 楼 @sanlengjingvv 问题解决了,确实是这样,google 一直打不开,get 不会执行,知道超时,谢谢大神啊
#1 楼 @chenhengjie123
服务器 LOG 日志如下:
info: --> GET /wd/hub/session/026078e28656196f6ef360e88aacb4b7/window_handles {}
info: [debug] Proxying command to 127.0.0.1:9515
info: [debug] Making http request with opts: {"url":"http://127.0.0.1:9515/wd/hub/session/026078e28656196f6ef360e88aacb4b7/window_handles","method":"GET"}
info: [debug] Proxied response received with status 200: "{\"sessionId\":\"026078e28656196f6ef360e88aacb4b7\",\"status\":0,\"value\":[\"CDwindow-86117E70-2D1A-F153-E29B-76A9BCF0B6A6\"]}"
info: <-- GET /wd/hub/session/026078e28656196f6ef360e88aacb4b7/window_handles 200 220.437 ms - 117
切换context:
info: --> POST /wd/hub/session/026078e28656196f6ef360e88aacb4b7/context {"name":"WEBVIEW_1"}
info: Available contexts: NATIVE_APP,WEBVIEW_1
切换end
info: [debug] Responding to client with success: {"status":0,"value":null,"sessionId":"026078e28656196f6ef360e88aacb4b7"}
info: <-- POST /wd/hub/session/026078e28656196f6ef360e88aacb4b7/context 200 3.660 ms - 72 {"status":0,"value":null,"sessionId":"026078e28656196f6ef360e88aacb4b7"}
开始get http://m.baidu.com/
info: --> POST /wd/hub/session/026078e28656196f6ef360e88aacb4b7/url {"url":"http://m.baidu.com/"}
info: [debug] Proxying command to 127.0.0.1:9515
info: [debug] Making http request with opts: {"url":"http://127.0.0.1:9515/wd/hub/session/026078e28656196f6ef360e88aacb4b7/url","method":"POST","json":{"url":"http://m.baidu.com/"}}
get一直卡住,等待超时
info: [debug] Didn't get a new command in 60 secs, shutting down...
info: Shutting down appium session
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"shutdown"}
info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN
info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"OK, shutting down","status":0}
info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
info: [debug] [BOOTSTRAP] [debug] Closed client connection
我的 Java 代码如下:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Emulator");
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME,MobileBrowserType.BROWSER);
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
for(String s:driver.getWindowHandles())
{
System.out.println(s);
}
((AndroidDriver)driver).context("WEBVIEW_1");
driver.get("http://m.baidu.com/");
好人啊。真不错
#2 楼 @lihuazhang 哦哦哦,了解了解
q 亲,你是 UCloud 公司的?
#2 楼 @lihuazhang 不是测试代码,是测试工具代码,测试代码倒无所谓哦
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MyCapabilityType.姓名, "aurel");
capabilities.setCapability(MyCapabilityType.ID, "cpfeng0124");
capabilities.setCapability(MyCapabilityType.公司, "苏宁易购");
capabilities.setCapability(MyCapabilityType.工作范围, "自动化测试平台开发、测试工具开发");
capabilities.setCapability(MyCapabilityType.工作年限, "4 年");
capabilities.setCapability(MyCapabilityType.兴趣方向, "测试开发、测试、自动化测试");
capabilities.setCapability(MyCapabilityType.发展方向, "自动化测试专家");
AndroidDriver driver = new AndroidDriver(new URL("http://testerhome.com/"), capabilities);
driver.study();
#11 楼 @seveniruby 通用的呀
#8 楼 @seveniruby 想法就是想二次开发 Uia 开源代码,自动解析控件定位符 (id/name 优先,没有 id/name 则解析成 xpath),然后生成控件操作步骤,这样就可以自动录制 Uia 的自动化测试脚本了