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

How to Install QTP on Citrix Environment? Possible send me the installation steps.. That would be great help

1 Answers  


how do u create new test sets in TD

1 Answers  


1. How to capture data from images in QTP and produce them in Excel sheet

1 Answers   Broadridge,


i have two questions for regular expression :- Q1. I have date pattern eg-29/11/2011 29-11-2011 29.11.2011 Que- if any separator is there between date,month and year pattern should match else it should not match eg- pattern should not match in case of 2911-2011 Q2. let say i have a string and there is a number in between of that string eg.-Amount 30002.234 successfully credited to your account . now i have to match this pattern in such a way that even if decimal is not there pattern should match ,how i will do this using regular expression

0 Answers  


what is Property......End Property loop? how to write sript for it in QTP

0 Answers  






how we can do web browser using parametarisation in QTP ?

2 Answers   Efextra, Kanbay,


How to make arguments optional in a function?

1 Answers   IBM,


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  


Hi,iam new to automation and i have 1 year experience in manual testing.I have a little bit idea about QTP9.0 .But i have no idea about script writing using VB.Please help to learn script writing.

1 Answers  


I Scheduled a QTP Script on remote desktop. Script is going to failure,when remote desktop connection fails.I have to open my remote desktop untile the scripts exection completes. If I disconnect my remote desktop connection, script is going to fail. Could you please any assist in this?

2 Answers  


How to Save your test using QTP?

1 Answers  


In website, protocol has been changed http:to https what you will do? tell me your approach?

1 Answers  


Categories