Appium 安卓应用程序。设置单击/点击之间的自定义超时
我正在使用appium 1.7.2,并试图在2秒内单击同一元素3次。为此,我尝试将“ActionAcknowledgementTimeout”更改为400毫秒。我猜默认的后端是UIAutomator2。那么这是一个bug还是UIAutomator2不支持ActionAcknowledgementTimeout?感谢你的指点Appium 安卓应用程序。设置单击/点击之间的自定义超时,appium,ui-automation,appium-android,Appium,Ui Automation,Appium Android,我正在使用appium 1.7.2,并试图在2秒内单击同一元素3次。为此,我尝试将“ActionAcknowledgementTimeout”更改为400毫秒。我猜默认的后端是UIAutomator2。那么这是一个bug还是UIAutomator2不支持ActionAcknowledgementTimeout?感谢你的指点 cfg = Config.instance() self.driver = webdriver.Remote( command_executor="h
cfg = Config.instance()
self.driver = webdriver.Remote(
command_executor="http://127.0.0.1:4723/wd/hub",
desired_capabilities= {
"app": cfg.apk_path,
"platformName": cfg.platform_name,
"platformVersion": cfg.platform_version,
"deviceName": cfg.device_name
})
# inject Id
self.session_id = self.driver.session_id
# tweak delays
androidTimeoutParams = {
"settings": {
"actionAcknowledgmentTimeout": 400,
}
}
self.driver.execute(MobileCommand.UPDATE_SETTINGS, androidTimeoutParams)
# check what we have after update
settings = self.driver.execute(MobileCommand.GET_SETTINGS, {})
print(settings)
根据日志,单击之间的默认超时时间为~3s
单击的示例代码
el = self.driver.find_element(*Locators.HIDDEN_BUTTON)
#three taps on hidden menu
el.click() # expect 400 ms timeout but get 3000ms
el.click() # same
el.click() # same.
根据接受的答案进行更新。下面的代码片段工作正常,无需任何额外的移动
action = TouchAction(self.driver)
action.press(el).release()
action.press(el).release()
action.press(el).release()
action.perform()
尝试使用触摸动作,并使用类似于按下(…).release().press(…).release()的动作