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 ?

Answers were Sorted based on User's Feedback



How do I check that the names in a weblist are correct e.g in flight application the names of item..

Answer / 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

How do I check that the names in a weblist are correct e.g in flight application the names of item..

Answer / satyanj

First save all item names in DataTable with column
name "FlyFrom" and follow the script:

Val1 = dataTable.Value("FlyFrom")
i = 0
itm = Window("F.R.").WincomboBox("Fly From:").GetItem(i)
If Val1 = itm then
reporter.reportevent 0,"<Step Name> ","<pass>"
else
reporter.reportevent 1,"<Step Name>","Fail"
EndIf
i = i+1

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More VB Script Interview Questions

What is the difference between do until loop and do while loop?

0 Answers  


Explain few date functions in vbscript?

0 Answers  


Mention the environments where vbscript could be run?

0 Answers  


I want to import the sheet from the Excel to the Datatable using VB Script. I used the Syntax as 'Datatable.ImportSheet "Filename","SourceSheet","Destinat ionSheet" Ex: Datatable.ImportSheet "D:\Data1.xls","Sheet1","Global" Qtp producing run time error,How I can solve the problem

1 Answers  


To get data from table which method will be used in QTP

3 Answers  






What are lbound and ubound in the vbscript language?

0 Answers  


How to load vbs functions in qtp

2 Answers  


How will you generate Reports using Vb Script?it asked in testing(QTP)Interview.Plz Any Body Let me know. Thanks uday Uday_testing@yahoo.co.in

4 Answers   NIIT,


How do you get the value of a combo box in Javascript?

2 Answers   Aspire,


If we take 2 strings as “good” and “bad” then what will ‘+’ and ‘&’ operators return?

0 Answers  


Consider there are objects in a webapp which are identified by QTP. Suppose you know only the logical name of a object(absolutely nothing else about it). Which approach will you take to find the "micClass" of the object(You can't use Object Spy, or can't add the object in repository)?

2 Answers   HCL,


How to make sure that items in a wintree are sorted al?

0 Answers   Ness Technologies,


Categories