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 |
Can you give me the code to calculate the total number of Links using the child object in the web page..? is there any other way to calculate number of links with out using the Child objects.??
2 Answers DST Global Solutions,
what is use of optionexplicit in variable declaration
How u will open the build automatically in QTP except using Systemutil.run command
what is descriptive programming?
What is the pros and cons between QTP and Rational Robot
How to use library files in QTP? how we can call these files in to script?
Explain the check points in quicktest professional?
What is descriptive programming?
Where the text version of script file located in file system?
How do you return a value for an array.
what is the purpose of SetTOProperty Method?
1 Answers Cap Gemini, iGate, Wipro,
Hi, how can we retrieve a specific value from Excel Sheet (Not datatable. for externel file).i mean to say from .xls file. and also tell me from xml file and .doc file. and how can u parameterize ur script from .xls file.(Not data table).