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 / tvs ramakrishna chowdary
Dim filesys, demofolder, fil, filecoll, filist, ctr1, ctr2,
ctr3
ctr1 = 0
ctr2 = 0
ctr3 = 0
Set filesys = CreateObject("Scripting.FileSystemObject")
Set demofolder = filesys.GetFolder("E:\mk")
Set filecoll = demofolder.Files
For Each fil in filecoll
x= fil.name
If filesys.getExtensionName("E:\mkt\" &x) = "txt"
Then
ctr1 = ctr1+1
msgbox "total text files:"&ctr1
End If
If filesys.getExtensionName("E:\mkt\" &x) ="xls"
Then
ctr2 = ctr2+1
msgbox "total excel files are:"&ctr2
End If
If filesys.getExtensionName("E:\mkt\" &x) ="doc"
Then
ctr3 = ctr3+1
msgbox "total word files are:"&ctr3
End If
msgbox x
Next
msgbox("The count for Text files is: " & ctr1 & " The
countfor Excel files is: " & ctr2 &" The count for Word
files is: " & ctr3 )
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
hi can anybody help with an qtp 9.2 license key please. Thanks, Nitesh.
How to handle dynamic objects in quicktest professional (qtp)?
How can you identify the browser and its information using QTP script?
Can any one send me the QTP Basic Coding Samples?
How many types of parameters are there?
How you can make an action as re-usable action?
I have developed and executed a script successfully, and saved the same to QC. When I tried to execute the script from QC, the script is not executing. What are the possible reasons?”
I am getting an error "failed to open the XML checkpoint result viewer" in result window,after clicking on "View XML checkpoint results".Someone suggest me settings,if any...
How many types of parameters are available in quicktest professional (qtp)?
can test automation improve test effectiveness?
Hi, How Accessibility checkpoint in QTP can be implemented in the test script?
Explain about the test fusion report of quicktest professional?
desribe a situation where u faced a stressful situation and how did u cope with it
Explain xml checkpoints.
How to get Traceability matrix from TD?