Appium Touch Action无响应

时间:2015-11-17 14:28:23

标签: capybara appium qa

我目前正在使用Appium来测试Ruby和Capybara,使用selenium作为Xcode ipad 2模拟器中的默认驱动程序。然而,当我尝试点击一个应该打开另一个标签的链接时,大多数测试功能正在工作时它会一直停滞(我不知道这是否是一个相关的事实,或者只是当用于对抗其他链接Capybara时行动似乎工作正常)。

find("#milLink").click => nil

但它只是以零返回,并尝试使用相同的"使用Capybara的.native方法。没有"返回并确认链接本身是可见的,并在单击它时手动工作。

附件是运行.click

时的appium代码
info: --> POST /wd/hub/session/835d6d18-95e7-4022-b2e8-89935463ad82/element
{"using":"css selector","value":"#imgMilitary"}

info: [debug] Waiting up to 0ms for condition
info: [debug] [REMOTE] Executing 'find_elements' atom in default context
info: [debug] [REMOTE] Sending javascript command

info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] Responding to client with success: {"status":0,"value":    [{"ELEMENT":"5071"}],"sessionId":"835d6d18-95e7-4022-b2e8-89935463ad82"}
info: <-- POST /wd/hub/session/835d6d18-95e7-4022-b2e8-89935463ad82/elements 200 9.082 ms - 92 {"status":0,"value":[{"ELEMENT":"5071"}],"sessionId":"835d6d18-95e7-4022-b2e8-89935463ad82"}
info: --> GET /wd/hub/session/835d6d18-95e7-4022-b2e8- 89935463ad82/element/5071/displayed {}
info: [debug] [REMOTE] Executing 'is_displayed' atom in default context
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote  debugger

info: [debug] [REMOTE] Receiving data from remote debugger

info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"835d6d18-95e7-4022-b2e8-89935463ad82"}
info: <-- GET /wd/hub/session/835d6d18-95e7-4022-b2e8-89935463ad82/element/5071/displayed 200 10.127 ms - 76 {"status":0,"value":true,"sessionId":"835d6d18-95e7-4022-b2e8-89935463ad82"}
info: --> POST /wd/hub/session/835d6d18-95e7-4022-b2e8-89935463ad82/element/5071/click {}
info: [debug] [REMOTE] Executing 'click' atom in default context
info: [debug] [REMOTE] Sending javascript command
info: [debug] [REMOTE] Sending _rpc_forwardSocketData: message to remote debugger

info: [debug] [REMOTE] Receiving data from remote debugger

info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] got applicationSentData response
info: [debug] Responding to client with success: {"status":0,"value":null,"sessionId":"835d6d18-95e7-4022-b2e8-89935463ad82"}
info: <-- POST /wd/hub/session/835d6d18-95e7-4022-b2e8-89935463ad82/element/5071/click 200 29.741 ms - 76 {"status":0,"value":null,"sessionId":"835d6d18-95e7-4022-b2e8-89935463ad82"}

现在发现了Appium Touch Action方法,但现在又出现了不同的错误

[2] pry(#<Object>)> action = Appium::TouchAction.new
=> #<Appium::TouchAction:0x007fe78dc17a10 @actions=[]>
[12] pry(#<Object>)> find("#milLink").native.location
=> #<struct Selenium::WebDriver::Point x=18, y=843>
[13] pry(#<Object>)> action.tap(:x=>18, :y=>843)
=> #<Appium::TouchAction:0x007fe78dc17a10
 @actions=[{:action=>:tap, :options=>{:x=>18, :y=>843, :count=>1}}]>
[14] pry(#<Object>)> action.perform
NoMethodError: undefined method `touch_actions' for nil:NilClass
从这里可能有一个类似的计时问题我发现但我不知道Capybara的等价物或我如何启用或执行等待{} https://github.com/appium/ruby_lib/issues/346

任何帮助都会受到赞赏,这让我疯狂。

0 个答案:

没有答案