Skip to content

[FEATURE]: New Task: shift+click, or more general keypress+click #195

@imnasnainaec

Description

@imnasnainaec

Description

I would like a new WebDriver Task for holding a key (or keys) and clicking. With Key in the constructor, the method could be something like as follows:

        /// <summary>
        /// Clicks the web element while holding the specified Key.
        /// Use browser actions instead of direct click (due to IE).
        /// </summary>
        /// <param name="actor">The screenplay actor.</param>
        /// <param name="driver">The WebDriver.</param>
        public override void PerformAs(IActor actor, IWebDriver driver)
        {
            actor.WaitsUntil(Existence.Of(Locator), IsEqualTo.True());
            new Actions(driver).MoveToElement(driver.FindElement(Locator.Query)).KeyDown(Key).Click().KeyUp(Key).Perform();
        }

Alternatives

No response

Anything else?

I'd be happy to setup the pr--please let me know if I should proceed--or let somebody else do it.

We are needing shift+click for testing one function of https://github.com/sillsdev/TheCombine.

Commitments

  • I agree to follow Boa Constrictor's Code of Conduct.
  • I want to work on this issue myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions