Definite's Extractor

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

How-to click a GWT 2.0 button with Selenium

I am testing a web application with selenium.
Some buttons of the web app are rendered with GWT 2.0, they cannot be clicked by “click” command.

There are other pages that describe and address this problem, such as:
Selenium Testing of GWT 2.0 and
Simulating clicks on GWT push buttons with Selenium RC

Nevertheless, when I was also pondering this problem, an old GUI technique came to my mind. You can “simulate” mouse click by pressing tab until the target widget get focus, then press Enter to activate that widget. Similarly, you can press Enter on the web element by

keyPress(elementLocator, \13)

Where 13 is ASCII for return

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: