tvs ramakrishna chowdary


{ City } hyderabad
< Country > india
* Profession * te
User No # 41924
Total Questions Posted # 0
Total Answers Posted # 2

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 2
Users Marked my Answers as Wrong # 1
Questions / { tvs ramakrishna chowdary }
Questions Answers Category Views Company eMail




Answers / { tvs ramakrishna chowdary }

Question { EDS, 12702 }

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

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

Question { ADP, 29240 }

What is an other way of "Wait" statement in QTP
I dont want to use wait("Some number").
Can any one tell this please..........


Answer

timeout=0
expval=true
actval=window("Flightreservation").winbutton
("updsteorder").getroproperty("enabled")
while((expval<>actval) & (timout<30))
wait(2)
timeout=timeout+1
actval=window("FR").winbutton("UO").getroproperty("enabled")
wend
if(timeout=30)then
msgbox "update order btn is not enabled in given time frame
hence exiting action")
exitaction

Is This Answer Correct ?    0 Yes 1 No