How can we use the "CreateObject("Wscript.Shell")" in QTP
and what is the definition and purpose of it?
Answers were Sorted based on User's Feedback
If we want to work on operating system related functions
(like command prompt,windows registry....) then we go
for "Wscript.Shell".Actually this is vbScript class. WE can
not directly use this in qtp. For that one we need to
create one instance firstofall. Using CreateObject we can
create instance as followes.
Set oShell=CreateObject("Wscript.Shell")
oSehll.popup "Have a great day"
oShell.Run "cmd /k dir"
oShell.sendkeys "{ENTER}"
set oShell=Nothig
I hope this may useful.
Regard,
mahi.kotike@gmail.com
| Is This Answer Correct ? | 29 Yes | 2 No |
Answer / hemakumar.m
For perfoming keyboard operations "Wscript" is use full.
Eg:For Pressing "F5"
Set Object=CreateObject("Wscript.Shell")
Object.SendKeys "{F5}"
U can find this in qtp help.
| Is This Answer Correct ? | 10 Yes | 4 No |
how to write script in qtp(vbscript)..i mean with out application deployed..and how to call script1 into script2?
In a web page, one web table is present which is dynamic. In that table one of the column has links with the same inner text. write a script so that i need to click the third link.
How iteration is related to Test Results in QTP?
if devloper change only button names in present build then script will execute or not , why? Only gui changed.......
How u will do versioning in QTP?
I have multiple radio buttons i need to select a radio buton and i dont want to hard code i have a generic function for it there i have used select#0 so it selects first radio button but for other script i want to select the 4th radio button how i can make it still more generic
4 Answers Accenture, Acentia, LM,
How to test whether the navigation i.e. from one page to another is working r not using QTP for web based application. plz explain in detailed or mail the sample code to malepatin@gmail.com
how to merge object repositories?
How to export(copy) the entire webtable from the webpage into Excelsheet? using Vb scripting
How will you find the current time of the remote machine using QTP script?
Could anyone please tell me one situation where you have used recovery scenarion in real time with an example?
how to write this script using descriptive programming? the script below is the script generated by QTP plz write the script using descriptive programming? plzzzzzzzz do answer thanku Browser("Welcome: Mercury Tours").Page("orkut - login").WebEdit("Email").Set "test123" Browser("Welcome: Mercury Tours").Page("orkut - login").WebEdit ("Passwd").SetSecure "475259b450e3d212bef4a5f5ce9d32ebcbf4" Browser("Welcome: Mercury Tours").Page("orkut - login").WebButton("Sign in").Click Browser("Welcome: Mercury Tours").Page("orkut - home").Link ("Logout").Click Browser("Welcome: Mercury Tours").Page("orkut - login").Sync Browser("Welcome: Mercury Tours").Close