Git Product home page Git Product logo

Comments (4)

DrMarcII avatar DrMarcII commented on July 27, 2024 1

If you do the following it should get the desired behavior:

// modifier keys are supposed to be sticky across multiple calls when using keyboard.sendKeys:
// https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidkeys
await driver.keyboard.sendKeys(Keyboard.control);
// element.click() might work, but I am not sure that it is guaranteed to keep the keyboard state as it
// part of the "do as I mean" API not the "do as I say" API.
await driver.mouse.click(element);
// a second call to the same modifier key releases it:
// https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidvalue
await driver.keyboard.sendKeys(Keyboard.control);

If this doesn't work, it indicates a bug in the remote end, not a bug in webdriver.dart.

As for the /actions endpoint, no remote ends implement yet (although marionette/geckodriver will hopefully do so soon). When it is available in some endpoint, we will see about implementing it here.

from webdriver.dart.

andrey-zakharov avatar andrey-zakharov commented on July 27, 2024

sendChord doesn't help, as we should hold ctrl and click by mouse, sendChord, as I can understand, sending only "ctrl+a" key codes and not holding key modificators.

from webdriver.dart.

patkujawa-wf avatar patkujawa-wf commented on July 27, 2024

I would also really appreciate this functionality. Looks like we need to add support for 17.5 Perform Actions, which is a bit more clearly described in https://github.com/SeleniumHQ/selenium/wiki/Advanced-User-Interactions.

And here's a python Action Chains API, for comparison. EDIT: Looking at the underlying code, I don't think the python ActionChains are actually using the Actions API.

It seems even the java code doesn't use the /actions endpoint, so I guess we're all just waiting for the spec to finalize a bit more before fully implementing?

from webdriver.dart.

patkujawa-wf avatar patkujawa-wf commented on July 27, 2024

Thanks for the code, that works (in Chrome) with a tweak (driver.mouse.click() doesn't take an element, it takes an optional mouse button). I tested with SauceLabs in Chrome on Windows and Mac and it worked great. Firefox and IE11 on Windows both don't support the moveTo command, so dice there, unfortunately.

from webdriver.dart.

Related Issues (20)

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.