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 many types of recording modes in qtp?

587


Is it possible to merge two object repository files in qtp?

618


If there is a change in the object type eg: A button is changed as link, 1. How to edit that in the shared object repository. 2.What options are available to edit the object within shared object repository other than copy from loca; 3.What would be the effect of the change in Coded Scripts within QTP and Functions stored in .vbs file which are loaded and used in QTP

1301


I recorded a Web App with a Oracle backend using QTP 9.5 and for some reason the scripts don't play back> What am I missing at this point. I recorded the same Apps under Sybase and they work great. This is Oracle 10g. Why won't my scripts play back.

1515


Discuss quicktest professional environment?

590






What is the file extension of the code file and object repository file in QTP?

597


What are the different kinds of test steps?

570


What is object spy in quicktest professional?

619


What are the Disadvantages of shared object repository?

571


how can i pass a "cript"as a parameter in to a function

1459


Hi Friends, How many types of Data Bases available in market... What is the diff. while using Syabase and Oracle in a Project... ? and what is the main diff. of Syabase and Oracle databases... ? Thanx in advance..

1514


What is meant by a Check Point in UFT? Also, explain the applicable Check Points.

705


how do u plan test automation?

1443


i'm testing the webpage with QTP, in this wabpage i have to choose the CV from the window, but QTP can't recognize the object, so i used the Low LEvel Recording, but every time i run the test, QTP go to halt when it gets to the Recorded part, any solution for that?( except puting delay in the script and manuall selecting, because i've did that)

1553


give me an example where u used good judgement and logic in solving a problem

3360