How do I check that the names in a weblist are correct e.g
in flight application the names of item are Denver,
paris,London, etc. How do I ensure the correct item is
displayed from the list after doing item count ?

Answer Posted / bfakruddin

Good Satyanj...

expected values in Datatable...!



'Code is here

dim obj_cnt,obj_val,exp_cnt,exp_val

set obj_cnt=object.getitemcount

for i=0 to obj_cnt-1

obj_val=object.getitem(i)

exp_cnt=datatable
("column_Name",dtGlobalSheet).getrowcount

for j=1 to exp_cnt

exp_val=datatable
("column_Name",dtGlobalSheet).value

if (exp_val=obj_val) Then

print "Expected Object is found in
List of Values"

reporter.reportevent
micpass,"Object has been found","Step is passed"

End if
End For
reporter.reportevent micfail,"Object doesn't found",
Next

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the differance between BYVAL,BYREF?

1764


What are the naming conventions while declaring a variable in the vbscript language?

614


what is the standards used for writing the script in QTP

1885


How to Import data from a file (file is on the desktop) to the data table

1577


hi what is called GUI in QTP 8.2 and how can we test the apllication using GUI?

1782






Is VB Script Case sensitive or Case insensitive?

631


In what way program "hello world" you can write in vbscript?

643


1.I want to establish connection with excel and also want to fetch the data using SQL queries. 2.the code should be written in such a way that in future if I want to migrate from excel to MS excess database , then there should be minimal changes.

1514


If else for do while select in vb script?

638


Could Anybody Please tell me What is the script for Find 3rd Largest element in the Array without using a SORT function int Find(int arr[], int size); Thanks in Advance..

2018


What is the purpose of on error resume next statement?

575


what is resorceallocation

1772


How will you get a subset of a array in vbscript?

583


Mention how to create a cookie using vbscript?

526


Hello friends..... Can any give the methods for Ms-Access, and Mozilla firefox in Automation Object Model in QTP. Please give me currect answers... if you do not understand my question please don't give answers. Thanking you.

1846