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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Shall we add Local Repository to shared object repository,if yes,how we add

5672


write script for bitmap image?

1534


Suggest and Define a solution for an application whose objects are not recognized by UFT?

666


What are the flaws in water fall model and how to overcome it?

557


How do you perform Regreession Testing?

1458






Hi. please provide license key for QTP 9.2, I have windows XP on my machine Thanks in Advance, moreshwar

2794


how will you load the test cases in ddt?

1592


When you open QTP, how many sheets you can see?

652


For which type of projects the iterative model is not suitable?

1429


Explain process of smart Identification in QTP?

597


Give me some real time point of way where exactly we can conduct audits?

1497


What is the difference in testing a client-server application and a web application?

579


How to execute a winrunner script in quicktest professional?

552


How would you export a script from one pc to another in qtp?

655


I have many listboxes in my application. I have to check whether the contents inside the listboxes are in sorted order or not..can anyone please send the code as early as possible

1444