what r the send key commands in QTP why they r used



what r the send key commands in QTP why they r used..

Answer / pradeep.yaksiri

Sendkeys method is like boon for QTP testers, In some cases
QTP tool becomes dumb and not able to identify or record the
windows based application, In that case rather than not
doing anything we can still automate it using sendkeys
method. You can send any character to application to perform
specific action i.e If you want to close the notepad then
you can do it by sending,
1. ALT+F and
2. X.
Or
only ALT+F4

In QTP how can we perform this action? Let's take one simple
and practical example.

Following is the simple example which perform closing
notepad action using sendkeys method in qtp.
==============================
Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "%f"
wait 3
WshShell.SendKeys "x"
wait 3
Set WshShell = Nothing
==============================
OR
==============================
Set WshShell = CreateObject("WScript.Shell")
wait 2
WshShell.SendKeys "%{F4}"
wait 3
Set WshShell = Nothing
==============================

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More QTP Interview Questions

what is output value in QTP and how it can be used in automation testing

0 Answers  


why qtp supports vbscript? and not for others just like cgi,phython,shell,perl,html and all..

4 Answers   Cap Gemini,


In automation testing Can we retest virtual object in the application after getting new version from the developers, is there any property will change for that object or it won't.?

1 Answers   Siemens,


How To Export The Screen Shoots Along With The Test Reports In QTP Version 10? Thanks In Advance SenthilKumar

1 Answers  


How to Parameterize Object repository in QTP?

6 Answers   Cognizant, IIBM,






how to write the descriptive programming in QTP for loginwindow.without using Step generator,object repository for referecnes

4 Answers   STC,


explain structured testing? plz guys with exp. do answer

0 Answers  


In an application you have a web table. You are provided with an external Excel sheet with the same structure as that of the web table. How will you retrieve all data from the web table and compare it with corresponding data available in the excel sheet, using QTP? How will you report the results in QTP?

1 Answers  


What is an object repository?

0 Answers  


how to use the regular expression for the below code-- swf("application name").swftreeview ("Treename").select"Medication;Pharmacy:56" There is a tree view window of the folder's ie Medication- >Pharmacy(sub folder)with 56 as count of records...The records can be different or if no records present in the specific folder..then it show "Paharmacy:-no records".Whe i record at the first time .....and try to rerun the same script with different records count say "pharmacy:800"..qtp is not regnizing it...therefore i want to user regular expression..but donot now how to use it and where to use...i have tried.... swf("application name").swftreeview ("Treename").select"Medication;Pharmacy:\*"..but it s of no use..plz help..me

0 Answers  


I want different types of discriptive programming statments coded for different types of web-objects?Give syntax and example?

2 Answers  


With what extension you can save the list of tests in a file to run in test batch runner?

0 Answers  


Categories