Hi. Today I will show you how to type and use the keyboard controls with QTP/UFT. This comes handy for various applications that don't work with standard QTP/UFT methods.
Follow the steps below:
1. Click Here. This will take you to the automation practice page.
2. Scroll down until you see the "Successfully fill out this form" form field
3. Copy and paste the following code in your script. It will click on the email sign up text field of this form. Browser("Index:=1").Page("title:=.*").WebEdit("html id:=et_pb_signup_firstname").Click
4. We will now use the keyboard keys function to fill out the form. Copy the function below and paste it in your script.
Set wShShell = CreateObject("Wscript.shell")
Set wShShell = Nothing
5. You can now call the function as in the example below. Just make sure to click on the email field first so QTP knows where to start filling out the form.
fun_TypeKeyboardKeys "Test User"
fun_TypeKeyboardKeys "[email protected]"
The first line enters the name. The second line tabs over to the next field. The third line enters the email. Then we tab over to the Sign Up button. Finally, we submit the form by click enter on the keyboard. Really cool right?
Leave your comments and questions below! We love all of your feedback!!
Latest posts by Admin (see all)
- SQA QTP tutorial – WebList identified as a web element and how to select an item from this list - December 9, 2015
- Automation QTP tutorial-double clicking on any object - December 4, 2015
- Software Automation QTP tutorial – 5 top reasons for using automation - November 23, 2015