我在appium 1.7.2上使用python-client,并尝试在2秒内单击3次相同元素。为此,我尝试将" ActionAckNowledGementTimeout"更改为400毫秒(在文档中找到(。我猜默认后端是uiautomator2。那么它是错误还是uiautomator2不支持ActionAckAckNowLedgemttimeout?感谢任何指针
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()
尝试使用触摸操作接触python,并使用类似于(...(。repares((。press(...(。版本(...(。版本((.....