Giter VIP home page Giter VIP logo

Comments (5)

licanhua avatar licanhua commented on August 17, 2024 1

Thanks. you are hit endpoints: session/279196bb-d37f-4293-80c7-9953fabc984a/actions with parameters

      {"actions": [{"type": "pointer", "parameters": {"pointerType": "pen"}, "id": "mouse", "actions": [{"type": "pointerMove", "duration": 250, "x": 396, "y": 210, "origin": "viewport"}, {"type": "pointerDown", "duration": 0, "button": 2}, {"type": "pointerUp", "duration": 0, "button": 2}]}]}`

and this endpoint is not implemented yet.

Likely it already have right click(RIGHT = 2) in the code base,
image

There are two possible solutions:

  1. add the actions endpoint into the codebase to support actions above.
  2. make the client send out click with additional parameters "button":"2"
    POST Request: 127.0.0.1:4723 /session/279196bb-d37f-4293-80c7-9953fabc984a/element/42.2428328.4.5/click
    {"id": "42.2428328.4.5", "button":"2"}

from ywinappdriver.

licanhua avatar licanhua commented on August 17, 2024

The 2nd solution should already supported because it's defined in [json wire protocol]
(https://www.selenium.dev/documentation/legacy/json_wire_protocol/#sessionsessionidclick) by some client
image

from ywinappdriver.

vjacobjo avatar vjacobjo commented on August 17, 2024

Thank you so much for the quick response :)

I don't think we can extend the Appium-Python-Client to provide additional parameters based on the documentation: http://appium.io/docs/en/commands/element/actions/click/
https://github.com/SeleniumHQ/selenium/blob/676c4cc8bbb0c113e5218e824df1fbd5d4a02a7d/py/selenium/webdriver/remote/webelement.py#L79

Even when right-clicking worked in version 1.3.0 (Selenium 3~), the right click was executed via action chain. In my python code , lines 42-43 demonstrate the code that used to work in the old version.

I could log a bug on Appium-Python-Client's end to provide this functionality, but if we were to take matters into our own hands, I think the 1st solution where we implement the actions endpoint seems to be the only way.

from ywinappdriver.

vjacobjo avatar vjacobjo commented on August 17, 2024

Dug a little deeper into the issue. So the click functionality from the client side is implemented in Selenium. Someone else already asked about potentially adding the ability to extend click to specifying mouse button:
SeleniumHQ/selenium#8654

This issue was posted two years ago. Nevertheless, I did log an issue in the W3C github repo:
w3c/webdriver#1647

It would be starting to look like going for option 2 would require a lot of hands to implement.

Is there anything on my end I could do?

from ywinappdriver.

licanhua avatar licanhua commented on August 17, 2024

You may choose C# for right click test cases. WinAppDriver has good support with C#, and possible Java.

If you stick with Appium-Python-Client, you may implement Actions endpoint based on YWinAppDriver. Of course, new PRs are welcome.

Some selenium clients allow user to send the raw data, but I don't know if Appium-Python-Client allows you to do it or not.

I didn't have other solutions in mind.

from ywinappdriver.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.