Favourite Quote

Every artist was first an amateur. - Ralph Waldo Emerson The more difficulties one has to encounter, within and without, the more significant and the higher in inspiration his life will be. - Horace Bushnell

Saturday, February 26, 2011

How to does selenium work with Tabbing

Key Press and Fire Event
Imagine that if you have a function in your application that can be invoked by pressing the "Tab" key.

Eg. Values being populated on focus out.

We can use keyPress with ASCII value for the key which you want to trigger the function.

Command Target Value
keyPress Txt_Login \9

here "\9" is ascii value of horizontal tab.

Some functions may be used Onblur. It will trigger the function when the field looses the key focus.

We can use fireEvent with "blur" or "focus" command as follows:

Command Target Value
fireEvent Txt_Login blur automationwithselenium.blogspot.com-Google pagerank and Worth

No comments:

Post a Comment