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 / bathi

set fso=createobject("scripting.filesystemobject")
set objfolder=fso.getfolder("XXX")

set fil=objfolder.files

for each fils in fil
fils1=fils1&fils.name
next

xls=split(fils1,".xls")
msgbox ubound(xls)

doc=split(fils1,".doc")
msgbox ubound(doc)

txt=split(fils1,".txt")
msgbox ubound(txt)

I guess, this will work........
Good Day........

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to acess a test in RSA?

1768


Difference between action & Reusable action?

747


Hi frnds, does anybody know if there is anything called "thin point" or something in qtp? thanks in advance.

1641


What are the advantages of a Hybrid framework?

699


assume i have few url link how will i dynamically call then using descriptive programming?

1692






Can we Test Welcome Screens and Process Images with QTP

1507


Did QTP prove efficient for your project? Yes or No, explain?

6220


What is the file extension of the code file in qtp?

642


How QTP support all types of applications (platforms)?

4143


Hello, Is there any way to send the test results in html format (or any other) by email using outlook after the test run ends? thank you in advance

1853


If I change the property value at runtime is it effect is object repository?

703


How to break the object spy ?

744


How to handle dynamic objects in quicktest professional?

586


What is the syntax to call one script from another? And what can be the syntax to call one “action” in another?

782


Can an action have 2 shared object repositories associated with them? In that case, if two of them contain the same object, which one will be considered?

684