#3 楼 @532589730 这么早上班了啊?
这个错误是在 unknownCommand 的时候抛出来的。
exports.unknownCommand = function (req, res) {
logger.info("Responding to client that we did not find a valid resource");
res.set('Content-Type', 'text/plain');
res.send(404, "That URL did not map to a valid JSONWP resource");
};
你直接访问 http://localhost:4723/wd/hub, 当然会出这个错误,因为没有 routing 对应。
至于脚本为啥出错,需要更多的信息。
Original error: A valid device type is required in the capabilities list)","origValue":"A valid device type is required in the capabilities list"},"sessionId":null}
#4 楼 @jiguanghover 为什么不看帖子呢?
#22 楼 @hwm831002 哦,忘记和你说,只支持 mac 的。。。
#19 楼 @hwm831002 你要在模拟器或者机器上启动应用先
#13 楼 @hwm831002 2003 建议你 google 下?
#11 楼 @hwm831002 手机的驱动要装呀。 你装个百度手机助手试试看。现在这些手机助手都能认出你的手机来
#9 楼 @hwm831002 没有啊。。。
这种算。
#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 还没做这些方法。