Hi,
this is venkatesh.
Q: I have 10 files in a folder(say D:\). Out of which there
are some .txt, .xls, .doc. I want to know how to get the
count of each file using qtp?
If U have any ans, plz write script for that...
Answer Posted / balu
Dim filesys, demofolder, fil, filecoll, filist, ctr1, ctr2, ctr3
ctr1 = 0
ctr2 = 0
ctr3 = 0
Set filesys = CreateObject("Scripting.FileSystemObject")
Set demofolder = filesys.GetFolder("c:\QTPtest")
Set filecoll = demofolder.Files
For Each fil in filecoll
If filesys.getExtensionName("c:\QTPtest\" & fil.Name) =
"txt" Then
ctr1 = ctr1+1
End If
If filesys.getExtensionName("c:\QTPtest\" & fil.Name) =
"xls" Then
ctr2 = ctr2+1
End If
If filesys.getExtensionName("c:\QTPtest\" & fil.Name) =
"doc" Then
ctr3 = ctr3+1
End If
'filist = fil.name
'filist = filist & " "
Next
msgbox("The count for Text files is: " & ctr1 & " The count
for Excel files is: " & ctr2 &" The count for Word files
is: " & ctr3 )
take and pandugachesukoooo....(if you r tulugu people you
can understood pandu... cool)
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
How to find the name of the machine where you are running your automation scripts in qtp?
How to analyzing test results using quicktest professional?
What is the differences between image check point and bit map check point?
Can any suggest me what is exposure testing?
How can we conduct U-I Testing by using QTP??????
what is the mail use of frame work(with detail). architecture for keyword driven frame work
Which is the best QTP training institute in Delhi/NCR region and what is the approximate fee for QTP course (Basics and Advanced)
I want to write some certification courses, so friends could you guide me? which certification is best and how to write exam and what tutorials need to be studied,what to do first, I am working on automation tool QTP 9.2
What are the differences between quicktest professional and winrunner?
What is RTM (require ment tracebulity marix) fromate?
Which environments are supported by hp qtp?
How many add-ins comes by default with quicktest professional?
Hi, Hope you viewers are doing fine with good health. What are the steps and connection parameters to connect to Oracle db ? Can you connect with just the Oracle client or Oracle XE ? Cheers!!
How to do the scripting. Is there any inbuilt functions in qtp as in qtp-s. What's the difference between them? How to handle script issues?
How to handle the exceptions using recovery secnario manager in quicktest professional (qtp)?