#7 楼 @hwm831002 被 adb 认出来就可以了
那是驱动的问题了。。。
和系统无关啊,这个论坛里都有解答的。 关键只有两点:
第一个例子,我也遇到过。。
测试产品遇见网络中断时应该怎么处理 我之前做的一个产品有这种异常的捕获的用例。我们是通过拔网线,然后测试会不会弹出提示框提示用户网络不好的这种类似的用例。然后校验点,是重新接通网络后,数据能不能正常上传,上传的数据是不是损坏的,断网前上传的数据是否正确等等。
你们可以用正式环境测啊,一次一分钱。。。
#13 楼 @twh_eastasia 我看了下,因为 remote.rb 把 Bridge 下面的代码都 private 了。 只有 rotatable.rb 才暴露了出来。
require 'uri'
require 'selenium/webdriver/remote/capabilities'
require 'selenium/webdriver/remote/bridge'
require 'selenium/webdriver/remote/server_error'
require 'selenium/webdriver/remote/response'
require 'selenium/webdriver/remote/commands'
require 'selenium/webdriver/remote/http/common'
require 'selenium/webdriver/remote/http/default'
module Selenium
module WebDriver
# @api private
module Remote
end
end
end
#11 楼 @twh_eastasia 顶,我看了源码,好像是传 symbol 的。ruby 好像是实现了。但是 开放出来的 api
在 bridge.rb 里面
def setScreenOrientation(orientation)
execute :setScreenOrientation, {}, :orientation => orientation
end
def getScreenOrientation
execute :getScreenOrientation
end
这两个方法,感觉没用。
rotation 方法是在 rotatable.rb 里面的
def rotation=(orientation)
unless ORIENTATIONS.include?(orientation)
raise ArgumentError, "expected #{ORIENTATIONS.inspect}, got #{orientation.inspect}"
end
bridge.setScreenOrientation(orientation.to_s.upcase)
end
alias_method :rotate, :rotation=
#1 楼 @twh_eastasia 哈哈 这个是我今天帮你看 orientation 的时候 发现的。坑爹。
#7 楼 @twh_eastasia 可以曲线救国,
selenium.execute_script("target.setDeviceOrientation(UIA_DEVICE_ORIENTATION_LANDSCAPELEFT);");
直接传 UIAutomation 的脚本过去。
第一个问题,我没试过。等别人来回答吧。
#5 楼 @twh_eastasia 看了下,应该是 rubybinding 的 webdriver 还没做这些方法。
#2 楼 @twh_eastasia 你要实时改的话, setOrientation 方法应该可以啊
首先 Orientation 应该都支持的,可以在 caps 里面设置。你可以试试看,
第二,确保你的 app 支持 Orientation
def capabilities
{
'browserName' => '',
'platform' => 'Mac',
'device' => 'iPhone Simulator',
'version' => '6.0',
'app' => absolute_app_path,
'deviceOrientation'=> 'LANDSCAPE'
}
end
贴代码呗,别截图。
@roro 你可以用 4.2.2 的 模拟器 试试看么?
但我看你的日志,没有去运行手机上的 apk 啊。。。 你看代码里是这样的:
desired_caps['app'] = PATH('../../../sample-code/apps/ContactManager/ContactManager.apk')
你确定你运行的时候,能找到这个 apk 么?
你是怎么运行的?能描述下么
目前为止,写的最有诚意的面试贴了,加精~
#14 楼 @seveniruby 只支持 chrome 这类浏览器吧