Objectives
The objectives of this article are :
- Learn how to use DOS command lines in QTP.
- Alternative complex tasks.
- Alternative .NET methods.
Posted in QTP Techniques
The objectives of this article are :
Posted in QTP Techniques
You must be logged in to post a comment.
April 16th, 2008 at 7:29 am
Thanks for such a good article.
Here i want to add few more points
1. wShell.Exec is useful only when two command are mutually independent of each other. Say Dir , md, cd etc these commands we can automate.
2. But if you are trying to automated some CLI utility like ftp or telnet,i guess wShell.Exec will not solve our purpose.
I will really appreciate any valuable suggestion on how to automate ftp, Telnet or any other CLI utility .
Thanks,
Manish Bhatla
April 16th, 2008 at 8:01 am
Hi manish
you right. it doesn’t work with cli, telnet, http://FTP.
the first method ( Type, GetVisibleText ) do work with telnet and cli, but is limited
for FTP we already have a solution, read the article FTP your scripts.
http://www.advancedqtp.com/knowledge-base/articles/files-id15/ftp-your-scripts/
April 17th, 2008 at 6:59 am
Thanks Daniva for your suggestion.
I already saw that article its very good.
I was looking for some generic solution for all CLI utility.
Thanks,
Manish Bhatla
April 17th, 2008 at 2:47 pm
Thanks for this gud article but i have following doubt
Alternate of GetText(0) and GetVisibleText functions on 64bit windows OS?
I want to read the output from command prompt window, don’t want to redirect to a file
On 32-bit OS I am using GetText utility which is working fine but for 64-bit OS like X64 or IA64 QTP function GetText is not working at all and GetVisbileText is not working properly
So I am looking for some alternate for this (GET THE TEXT FROM COMMAND PROMPT WINDOW AT RUN TIME ON 64-BIT OS?)
April 20th, 2008 at 7:00 am
Hi,
When I copy the statement from the article above and paste it in QTP Expert view, it throws errro : “Invlid Character”
eg : Line from your code:
Print Window( “object class:=ConsoleWindowClass” ).GetROProperty( “title” )
Then I have to delete all quotes from your statement and reinsert from keywboard. Please looki into it. and workaround it so that we can directly copy paste and use ur code.
Thanks
April 20th, 2008 at 10:11 am
It’s is a very informative material posted, i was wondering where could u get the whole set of information about advanced QTP….. Daily I get to know a lot when i go through this site…. Thanks a lot
May 2nd, 2008 at 6:54 pm
hi rajkamalinnit
yes…is a known problem when copying from articles.
those special quotes are symbols ( “Smart quotes” called by Microsoft.
until today i didn’t find a way to fix it…
so you have to fix it manually…sorry
May 4th, 2008 at 5:21 pm
Dani, rajkamalinnit - The issue has been resolved. All “smart quotes” are now automatically transformed to regular quotes when the page is displayed.
May 4th, 2008 at 6:17 pm
[…] to rajkamalinnit who alerted us to the issue, we’ve activated a workaround which intercepts the articles before they are […]
May 5th, 2008 at 9:17 am
Thanks for the excellent Code
May 7th, 2008 at 8:54 am
Very gud articles here
May 15th, 2008 at 8:02 pm
This Article was really helpful.
I was trying to work with wshell.run command for creating and copying File structures. But facing an QTP error while executing the commnads. Kindly Help
Please find the code below
1. wshell.Run “MKDIR C:\Test”
- Using this Command to create a Folder called Test in my C drive.
2. wshell.Run “XCOPY C:\Douments and Settings\SVeeram\Desktop\Sample.xls C:\Test\ /E/Y/F”
- Using this Command to Copy a excel file from my desktop to the folder created.
May 21st, 2008 at 12:25 am
Hi Suresh
i think that you are missing the quotes on the path name
Try this
cmd = “XCOPY ” & Chr(34) & ” C:\Douments and Settings\SVeeram\Desktop\Sample.xls” & Chr(34) & ” ” & Chr(34) & “C:\Test\” & Chr(34) & ” /E/Y/F”
Or
cmd = “XCOPY ‘C:\Douments and Settings\SVeeram\Desktop\Sample.xls’ ‘C:\Test\’ /E/Y/F”
May 22nd, 2008 at 6:41 am
Very useful info
June 19th, 2008 at 12:05 pm
Thanks a lot to creater of this site.
Really helpful.