简体   繁体   中英

How can I use browser.actions().sendKeys in protractor with “?” symbol?

I have a trouble in my tests with this code

browser.actions().sendKeys(Key.chord(Key.CONTROL, '?')).perform();

But it's work with another symbol. For example:

browser.actions().sendKeys(Key.chord(Key.CONTROL, 'a')).perform();

How can I use browser.actions().sendKeys in protractor with "?" symbol?

Assuming you want to open the browser's Help->Search, should not it be:

browser.actions().sendKeys(Key.chord(Key.CONTROL, Key.SHIFT, '/')).perform();

Note that I'm not sure if would be able to control the search input and send keys to it, since, I think it might be out of scope of the selenium webdriver.

And FYI, if you would want it be cross-platform, see:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM