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
Output values? i want a practical example
what is supply chain management?
how to find that tools work well with ur existing system?
What is reusable action?
in qtp if we record a object and we record the object using virtual wizard then by which way the object is recognized that means recorded
If the weblist is identified as webelement,and by clicking on webelement if the values are displayed,and if the values the values also identified as webelement.then how to fetch the values through script?
If an application name changes frequently i.e while recording it has the name, in this case, how do qtp handles?
If I give some thousand tests to execute in two days what do you do?
What is the extension of qtp local repository?
what is the hierarchy to use properties in descriptive programming
I would like to directly import XL file and work on that XL file directly in QTp script in that XL sheet need to allocate workbench,XL sheet and generate two bar graphs automatically how to do that? plz let me know any answers?
What is the script for database check point, bitmapchek point, regular expression ?
Does any one worked on JIL Emulator , Testing with QTP(automation). Trail Version of QTP is not identifying the child objects of JIL emulator, Can any one help me out ,
Why do we use "Text checkpoint" If we can make use of it in "standard checkpoint" ?
Step 3&4 are repeated until an the object in recognised uniquely.