Appium 关于 appium 使用测试中遇到的问题,断网情况下,测试脚本运行报错,连网的时候,就能正常运行

bingo · 2017年09月21日 · 最后由 bingo 回复于 2017年09月26日 · 1173 次阅读

我用的是 ruby+appium 做的测试 报错信息如下图

但在连网情况下,确不会报错
我的 appium 配置如下

希望大神指导

我的测试代码
require 'appium_lib'
#coding:utf-8

caps   = { caps:   { platformName: 'Android', appActivity: 'com.tencent.mm.ui.LauncherUI', appPackage: 'com.tencent.mm',deviceName: 'Android Emulator',unicodeKeyboard: "True"},
   appium_lib: { sauce_username: nil, sauce_access_key: nil } }
driver = Appium::Driver.new(caps).start_driver

sleep 10

driver.find_element(:xpath,'//android.support.v7.widget.LinearLayoutCompat/android.widget.TextView').click
driver.find_element(:xpath,'//android.widget.EditText[@resource-id="com.tencent.mm:id/gz"]').send_keys("浙江移动");
sleep 2
driver.find_element(:xpath,'//android.widget.ListView/android.widget.RelativeLayout[@index=1]').click;
sleep 1
driver.find_element(:xpath,'//android.widget.ImageView[@resource-id="com.tencent.mm:id/a4k"]').click;
sleep 1
driver.find_element(:xpath,'//android.widget.EditText').send_keys("查话费");
puts driver.find_element(:xpath,'//android.widget.EditText').attribute("text")
driver.find_element(:xpath,'//android.widget.Button[@text="发送"]').click;
共收到 2 条回复 时间 点赞
黑水 回复

好像跟版本没关系,因为一样的版本在其他电脑上是没有问题的,我的是 win10 ,别人的电脑是 win7

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册