In a Combobox(or) ListBox there some Values ...like...1,2,3,4. Using QTP how Check these Values are ....Dislying or not...Please Can any one Give the VB Script .....

Showing Answers 1 - 1 of 1 Answers

Hokrani

  • Aug 17th, 2006
 

*1st you have to add weblist to object repository. (To add weblist to object repository, right click on the weblist and select ?View/Add Object? and click on ?OK? button )

Suppose u added Weblist in the following Tree

 Home -> Mail -> 1list

 

* Stored the expected values in localsheet(Action1)

 Suppose u stored values under ?Input? column under Local sheet

 

* Use the following code.

Dim counter, NumOfRow

NumOfRow = datatable.Getsheet("Action1").GetRowCount

counter=0

Do while counter<NumOfRow

 

If (datatable.Value("Input",dtlocalsheet)=Browser("Home").Page("Mail").WebList("1list").GetItem(counter) )then

msgbox "correct value"

else

 msgbox "Wrong value"

 end if

 

counter= counter+1

Datatable.SetNextRow

 

Loop

 

It will work properly. Let me know if u have any question regarding this and anything more?don?t forget mail to me @ hokrani@gmail.com.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions