1
votes

I'm on appium 1.7.2 with python-client and trying to click on same element 3 times within 2 seconds. To do it I have tried to change "actionAcknowledgmentTimeout" to 400 milliseconds (found in docs). I guess default backend is UIAutomator2. So is it a bug or UIAutomator2 doesn't support actionAcknowledgmentTimeout? Appreciate any pointers

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)

Based on logs default timeout between clicks is ~3s.

Sample code which clicks.

 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.

Update based on the accepted answer. Following code snippet works just fine without any extra moves.

    action = TouchAction(self.driver)
    action.press(el).release()
    action.press(el).release()
    action.press(el).release()
    action.perform()
1

1 Answers

2
votes

Try to use Touch actions TouchActions Python and use something similar to press(...).release().press(...).release().....