How to apply ALT + SPACE + n keyboard event?

429 views
Skip to first unread message

Vardhan

unread,
Feb 20, 2014, 12:35:36 AM2/20/14
to seleniu...@googlegroups.com
Hi all,

I want to minimize my browser window by pressing ALT + SPACE + n key.
While running my automation, after minimizing the browser window manually, it pops up again whenever a log out / log in operation happens.
How can I implement the above mentioned combination using Actions class or any other idea will suffice.

Below is what i had tried:

        Actions action = new Actions(driver);
        action.keyDown(Keys.ALT).
perform();
        action.keyDown(Keys.SPACE).perform();
        action.keyDown(Keys.getKeyFromUnicode('\u004E')).perform();

i am getting an error while running it:

        Exception in thread "main" java.lang.IllegalArgumentException: Key Down / Up events only make sense for modifier keys.


Thanks,
Vardhan.

Aman Saraf Jain

unread,
Feb 21, 2014, 2:11:09 AM2/21/14
to seleniu...@googlegroups.com
hi,

Use robot class to handle key events try to give ascii value, yo may see the exapmle on http://amansarafjain.blogspot.in/2014/02/use-of-robot-class-this-sample-code.html

Thanks&Regards
Aman
Reply all
Reply to author
Forward
0 new messages