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

write a vb script to display the code "vbscripting" alphabet by alphabet(i e 1st v then b and up to g)

2 Answers  


Explain the .wsf files?

0 Answers  


Which in-built functions are used to convert the specified expression in the form of date and string in the vbscript language?

0 Answers  


how to add action through AOM in QTP

0 Answers  


which is the best institute in banglaore for software testing?

1 Answers  






Hi All, I am facing one problem in QTP. There is link object in my application that exist in the Frame in mozilla firefox. Click event on that object is not working but once the frame is enabled/activated then click event works fine.But the frame does not have the activate property. This problem is coming in firefox only. Regards

0 Answers  


write a vbscript for traffic signal

1 Answers  


accept a string & display whether a is present or not

1 Answers  


how to operate webobjects in a webpage using getobject function and then using generic methods?

0 Answers  


best training centre in bangalore

2 Answers  


Explain about tristate constants?

0 Answers  


HOw we can apply web service checkpoint in QTP 9.5? I tried it out with net connection also. But not getting success.

0 Answers  


Categories