Quality is delighting customers
Suppose we have data table with column name city and there we have names of all cities.Now my scenario is how to identify particular city(Ex.Bangalore) among them?How o check that how many times a country name has been repeated i,e for duplicatest?Using VB Script in QTP 10.0.
Thanks in Advance.
use .childitem(row,col,"mic class",index)
Thanks for u r reply.But i asked for data table not for web table.could u plz check once and clarify.
Traverse the webtable and fetch the cell data. If specific data found then increase the counter otherwise use childItem as mentioned by sahoo.
first initialize flag val to zero . By Using GetRowwithcellText Method we can get city whr exact it is located in a table, then after increment flag value +1 then u r will get count finally Print flag count...
plz correct me if i am rong
Please see the below code for your purpose
if wrong let me know the correct information
City=Inputbox("Enter city for found in datatable")
RC=Datatable.GetSheet(2).GetRowCount 'getting data from Action1 Sheet
For i=1 to RC
If Dtcity=City Then
If c>0 Then
print "City Existed:"&city
print "Existed Times:"&c
Thanks for u r reply.It is working fine.But i have one small doubt in the above code if instead of If Dtcity=City Then i used if strcomp(Dtcity,City,0) Then or if strcomp(Dtcity,City,1) Then.. it is giving wrong result could u plz clarify once....
Thanks in Advance...
if strcomp(Dtcity,City,0) does binary comparison and if strcomp(Dtcity,City,1) does textual comparison. Try to use LCASE or UCASE with them.
for i=1 to irows
if datatable("city",dtglobalsheet) <>"" then
print "city :" &city
Thank u reddy..