Long press is getting deprecated after selenium v4

Hey guys,

Many keywords are getting deprecated after selenium v4. I could see alternatives to most of those keywords but I am unable to find any alternative for long press. Would anyone like to help me resolve this issue? Thanks in advance.

You can try this one and modify the time parameter: https://serhatbolsu.github.io/robotframework-appiumlibrary/AppiumLibrary.html#Tap%20With%20Positions

Thanks for let me know, I was also planning to use but in which I would needing the coordinates of my element then only I will be able to press on it. Was looking for any easy alternative, If nothing works then I guess I would use this one.


Hi Zaid,

You could do something like this:

Zaids Long Press
    [Arguments]    ${Locator}    ${duration}=1000
    ${location}=    Get Element Location    ${Locator}
    @{loclist}=    Create List    ${location}
    Tap With Positions    ${duration}    @{loclist}

Put it in a common resource file and replace all Long Press with Zaids Long Press


Hi guys, my Tap With Positions is not working follow above example. Can help me resolve this issue?

${Locator}= Set Variable ${SignatureLocator}
${Duration}= Set Variable 1000
${location}= Get Element Location ${SignatureLocator}
@{loclist} = Create List ${location}
log to console @{loclist}
Tap With Positions ${Duration} @{loclist}

log to console @{loclist} i got result:

{‘x’: 86, ‘y’: 751}