I need to automate an Web application using QTP but how can i record Tabbing and Press Enter key? Is there any ways to record key board actions like this

Showing Answers 1 - 3 of 3 Answers

Sometimes keyboard events are not recorded or playback using QTP. In that case you can use Windows Scripting "SendKeys" method. I am giving you an example, for more information you can refer to the help of QTP.

'Code to send string "gajendra SHARMA" in two different lines on Notepad file.

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "notepad.exe"
WshShell.AppActivate "Untitled - Notepad" ' Activate the browser  or application to send the keys
wait(3)
WshShell.SendKeys "gajendra{ENTER}SHARMA"

You can e-mail at in case of any query or doubt.

Regards,
Gajendra Sharma

  Was this answer useful?  Yes

On the web based application, QTP doesn't record the keyboard events. In that case you can use Windows Scripting "SendKeys" method. I am providing you an example, for detailed information you can refer, QTP help.

'Script to send string "gajendra SHARMA"  in two different lines in notepad
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "notepad.exe"
WshShell.AppActivate "Untitled - Notepad" ' Activate the browser  or application to send the keys
wait(3)
WshShell.SendKeys "gajendra{ENTER}SHARMA"
Set WshShell=Nothing

Hope this will resolve the issue. You can mail me at : gajendraks79@gmail.com or buzz at 09818532026 in case of any query.

Regards,
Gajendra Sharma

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions