how to use command prompt using qtp?
Answers were Sorted based on User's Feedback
Answer / shobhit kaul
hi frnds in the above answer(by king) there is only one
change
as inspite of creating object of quicktest.applicaton
you should create object of wscript.shell
The code is as::
Set app=CreateObject("Wscript.shell")
SystemUtil.run("cmd.exe")
app.sendkeys "cd\"
app.sendkeys "~" 'its for enter key
app.sendkeys "default.xls" 'this xls should be any where
your c drive
app.sendkeys "~"
Please correct me if i am wrong any where
my emai id is
kaul.shobhit@gmail.com
| Is This Answer Correct ? | 13 Yes | 4 No |
using "Wscript.Shell" object we can work on command prompt
in qtp.
'create one instance for "wscript.Shell"
set oShell=CreateObject("Wscript.Shell")
'using run method we can invoke application
'/k this will display command prompt.we can also use /c but
we can not see command prompt.It will disappear after
executeion.
oShell.Run "cmd /k dir"
'if we want use multiple commands we can use "&"(amp) symbol
oShell.run "cmd /k dir & md qtp"
set oShell=Nothing
I hope it will useful.
Regards,
Mahi.kotike@gmail.com
| Is This Answer Correct ? | 9 Yes | 5 No |
Answer / king
Set =createobject("wscipt.shell")
a.run "cmd /K CD C:\ & Dir"
| Is This Answer Correct ? | 5 Yes | 4 No |
Answer / r.prasad
hi ,
u can open command prompt using following script also
dim app
set app=createobject("QuickTest.application")
SystemUtil.run "cmd.exe"
| Is This Answer Correct ? | 6 Yes | 5 No |
Answer / king
Hi Bathi,
dim app
set app=createobject("QuickTest.application")
SystemUtil.run "cmd.exe" 'the command prompt open
app.sendkeys "cd\"
app.sendkeys "~"
app.sendkeys "cd Foldername"
app.sendkeys "~"
app.sendkeys "dir *.xls"
app.sendkeys "~"
i think this is working properly accoring to my knowledge.
| Is This Answer Correct ? | 4 Yes | 3 No |
Answer / sandeep
To know ALL .XLS FILES in the folder. Please use file
system object.
Create file system object.
Check using fileExists method.
You can also make array of .xls file and return the array.
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / bathi
Hi King,
Thanks 4 the ans.
I want have still more clarification abt this. suppose I
want to know list all excel sheet present in some folder
using console. how can i do that?
| Is This Answer Correct ? | 2 Yes | 3 No |
I learned all the objects of my application in object repository thru English Language. now i want to use same object repository for other languages(French,Dutuch and Chinese)
Iam doing automation in Oracle App's using QTP? In App's because of some functional setup, keep on changing my script flow. for this how can i use the recovery sceanrio?? Please help me?
how to find that tools work well with ur existing system?
hi, can u tell me the QTP TEsting process in present real time companies?(beware of this... now a days Recording is not using,, only DP) and don't tell note book answers like step 1 spep2....like this .......post answer with professional skills in simple english words) thank u
am not having intrest in coding lang like c c++ java etc can i choose Testing tools as my carrier and please suggest me which tool is good (suitable for me)
How many types of recording modes in qtp? Which will be used when?
What is test automation framework?which framework does QTP follow?Need some practical explanation as to how u will start ur testing process following a particular framework?
Hi All As per the requirements i have to copy the data from word document to excel sheet using the QTP Note : Data in word document is in tabular format i.e there is 80 rows and 5 columns table Can any body provide code for this ? Thanks in advance Regards Test123Test
What are different types of frame works ?
How do u write a regular expression for date (dd/mm/yyyy) field ?
Hi.. I want to do parametrization for selecting perticular flighr say XYZ by using local table: criteria: 1.If flight is available msgbox "Flight is available" and then select flight from flight table and click to ok button after that as enter username and ticket no and then stop 2. otherwise msgbox " Flight is not available" and stop Please help me out ..and let me know your responses on dipak.bachhav@gmail.com Regard, Dipak
What is meant by Pseudo Code?