ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Testing  >>  Automation Testing  >>  QTP
 
 


 

 
 WinRunner interview questions  WinRunner Interview Questions
 Load Runner interview questions  Load Runner Interview Questions
 QTP interview questions  QTP Interview Questions
 Test Director interview questions  Test Director Interview Questions
 Rational TestSuite interview questions  Rational TestSuite Interview Questions
 Silk Test interview questions  Silk Test Interview Questions
 Automation Testing AllOther interview questions  Automation Testing AllOther Interview Questions
Question
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...
 Question Submitted By :: Venki
I also faced this Question!!     Rank Answer Posted By  
 
  Re: 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
# 1
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 ?    2 Yes 0 No
Bathi
 
  Re: 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
# 2
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 ?    3 Yes 0 No
Balu
 
 
 
  Re: 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
# 3
hi balu and bathi good work .........
thnks........
 
Is This Answer Correct ?    0 Yes 2 No
Chowdary
 

 
 
 
Other QTP Interview Questions
 
  Question Asked @ Answers
 
Syntax for how to call one script from another? and Syntax to call one "Action" in another?  2
What are the different scripting languages you could use when working with QTP ?  3
My project title is "DRUG Audition and research management" it comes which domain?  3
what is key word driven frame work how to use keyword driven frame in QTP in a project AppLabs1
how can we retrieve ten rows from the data table using loop concept?  3
What is the Diff between Image check-point and Bit map Check point?  2
What is output value?  2
Can I do Game testing with QTP tool  1
some times we write user define functions.where we write main and sub program,how,where to insert the functions in qtp? GE1
how to identify an object which is not in the object repository identification can be done using descriptive programming.  2
What are the Mandatory Properties of WebTable Object and Link Object in Web testing using QTP iLink2
Once we get the Test Result from QTP.,I Have to convert into Excel file format..Is it possible..Can any gudie me regarding this... For Example : Total Test Case is : XXXXX Test Case passed : XXX Test Case Failed : XXX -------- Total XXXXXX ---------  6
When I start recording any web application (either Mozilla or IE) QTP recognizes window instead of browser and also it does not show all the hierarchy tree of that particular web page. 1. Window("Mozilla Firefox").Check CheckPoint("Mozilla Firefox") 2. As everybody knows it should be browser("Mozilla Firefox").Check CheckPoint("Mozilla Firefox") I am using the windows vista, do you think it may be a problem of my settings in QTP or problem of my installation. Your kind responses will be appreciated. Thanks in advance. Satya  7
What is API?  1
what is the difference between link and hyper link? Ordain-Solutions1
What is Version control?  2
How do we retrieve the content from a text box in a web page  2
How to export data present in Datatable to an ".xls" file?  3
Have you ever written a compiled module? If yes tell me about some of the functions that you wrote.  1
What is Object Spy? Ordain-Solutions5
 
For more QTP Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com