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

int a=4857 i need output as 7584.without using any inbuild function?

6 Answers   Aspire,


How to get 120 using 5 zeroes, you can use any operator(+, *, /...) in qtp.

2 Answers   Cognizant,


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

1 Answers   IBM,


i have to open a notepad having no. of words in dat file by recording in qtp and then find a particular word and display true or false

0 Answers  


What are the disadvantages of vbscript?

0 Answers  






Can anyone help me in write coding to get this pattern * ** *** ****

3 Answers  


How can you create a file object to work with the files in the vbscript language?

0 Answers  


Mention how to assign a date value to a variable?

0 Answers  


If a calulator having 3 buttons (of any number)in 3 of them one is not working properly due to which answer is wrong always. write a script to find out which button is not working properly ?

0 Answers  


What are the uses of vb script?

0 Answers  


Open Yahoo Login Page in that page Suppose i have 100 mails and i want to delete 10'th mail now give procedure & Coding For that Scenario

4 Answers   AppLabs, IBM,


write a text script to display * as below ********** **** **** *** *** ** ** * * * * ** ** *** *** **** **** **********

1 Answers  


Categories