protractor icon indicating copy to clipboard operation
protractor copied to clipboard

Not able to use keyPress

Open snehas17-11 opened this issue 12 years ago • 4 comments

I have one flash video site to be automated and when clicked on full screen element , video is displayed in full screen.

I want to go back to normal view with ESCAPE keyboard event,

But it does not working browser.actions().keyPress(protractor.Key.ESCAPE).perform();

It throws an error like TypeError: Object [object Object] has no method 'keyPress' When I used keyDown browser.actions().keyDown(protractor.Key.ESCAPE).perform(); then it gives me another error. Error: Not a modifier key

Please Help.

snehas17-11 avatar Oct 16 '14 09:10 snehas17-11

Have you tried with this: ptor.actions().sendKeys(protractor.Key.ESCAPE).perform();

nicolastrres avatar Oct 16 '14 15:10 nicolastrres

Thanks for the quick reply

I have tried below

browser.actions().sendKeys(protractor.Key.ESCAPE).perform();

The test passed but it does not actually hit the escape key meaning the video still remain in full screen

Expected is It should go to normal view.

Please suggest further action.

snehas17-11 avatar Oct 16 '14 15:10 snehas17-11

The function is called sendKeys. Documentation here: https://github.com/SeleniumHQ/selenium/blob/master/javascript/webdriver/actionsequence.js

juliemr avatar Oct 16 '14 18:10 juliemr

Hi, I am facing the same issue. Has someone solved this.? I am preparing a generic keyword for my test cases to press escape key whenever require. The test case pases but the action is never completed.

Tarlochan avatar Mar 21 '16 09:03 Tarlochan