Pressing Ctrl+A in Selenium WebDriver

前端 未结 13 1013
一向
一向 2020-11-27 02:45

I need to press Ctrl+A keys using Selenium WebDriver. Is there any way to do it?

I checked the Selenium libraries and found that Selenium allow

13条回答
  •  清歌不尽
    2020-11-27 03:31

    It works for me:

    OpenQA.Selenium.Interactions.Actions action 
        = new OpenQA.Selenium.Interactions.Actions(browser);
    action.KeyDown(OpenQA.Selenium.Keys.Control)
        .SendKeys("a").KeyUp(OpenQA.Selenium.Keys.Control).Perform();
    

提交回复
热议问题