gpt4 book ai didi

ios - Appium::TouchAction.new.tap 无法正常工作

转载 作者:行者123 更新时间:2023-11-28 23:46:19 34 4
gpt4 key购买 nike

And(/^I click OK button in popup$/) do
#Appium::TouchAction.new.tap(x:0.64, y:0.57, count: 1).perform
Appium::TouchAction.new.tap(x: 270, y: 506,count: 1).perform
end

And(/^I click Allow button in popup$/) do
#Appium::TouchAction.new.tap(x:0.64, y:0.57, count: 1).perform
Appium::TouchAction.new.tap(x: 270, y: 506,count: 1).perform
end

给出下一个代码,我使用 Appium 1.9.1、Ruby 2.3.7 和 Cucumber 来自动化 iOS 应用程序,如果我传递相对坐标(百分比)——那么 appium 不会执行任何点击,但是,如果我用绝对坐标注释行,用相对坐标注释行 - 所有水龙头都可以工作。最奇怪的是,如果我在第一行使用相对坐标,在第二行使用绝对坐标——它会执行第一次点击,但不会执行第二次。我的目标是在任何地方都使用相对坐标,这样测试就可以在任何屏幕分辨率的设备上使用,如果有任何已知的使用相对坐标的解决方案(或者如果我做错了),请提出建议

最佳答案

看完您的代码片段后,我假设您正在处理 iOS 设备中的警报弹出窗口。

在 iOS 中,使用 Appium Java 客户端,我可以使用传统的 driver.switchTo().alert(); 处理弹出窗口。

Here driver refers to IOSDriver.

我确信在 Ruby 中也一定有与此等效的东西。

尝试使用 Alert 类接受警报而不是点击坐标。

关于ios - Appium::TouchAction.new.tap 无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52609320/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com