Definite's Extractor

My findings on Life, Linux, Open Source, and so on.

Selenium key combination handling

I am working on the testing our new web-based translation management system, flies with selenium.

I used to stuck on emulating the key combination handling, such as Ctrl-Enter until recently. Here are steps to emulate a Ctrl-Enter.

keyDown theElement \13
keyPress theElement \13
keyUp theElement \13

The “theElement” is the web element that you want your hot keys to be press on. Yes, you need all keyDown, keyPress, and keyUp events.

Note that PageUp and PageDown might not be working. As their keycodes seems to collide with ! and ".

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: