Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Checking if values of Listbox/Combo box on a web page the same with values in DB?
#4
Solved: 11 Years, 3 Months, 1 Week ago
Robocom-
You have the logic. You can easily find the solution too if you made a bit more research.

Whenever you post a question dont forget to give details like,

1. Version of QTP you are using ??
2. Application Interface host technology ?
3. Any third party controls or add-ins etc.

Now assuming it is a listbox let me extend to you a hint,

Code:
Dim oItems(100)

oListItems = obj.weblist("listbox").Getroproperty("all items")

oItems = Split(oListItems, ";")

oListCount = obj.weblist("listbox").Getroproperty("items count")
or
oListCount = Ubound(oItems)

For i = 0 to oListCount - 1 'Expecting values from DB are the same as on the application
     If Instr(oItems(i), ItemsfromDB(i)) >0 Then
             Reporter.reportevent micpass, "ITem exist", "Item exist"
         Else
               Reporter.reportevent micfail, "Item Does not Exist", "ITem does   not exist"
      End if
Next

I hope this helps. You may need to tweak it according to your requirement.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Messages In This Thread
RE: Checking if values of Listbox/Combo box on a web page the same with values in DB? - by basanth27 - 07-02-2009, 06:52 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Dynamic Values Identification PreethiJoshi 1 1,178 04-26-2018, 10:50 AM
Last Post: Ankur
  Need help for copying values from one excel to another excel vinodhiniqa 0 1,338 07-06-2017, 05:33 PM
Last Post: vinodhiniqa
  click each web link in a page using Index or other method in QTP smeijer 13 24,591 04-29-2017, 04:53 PM
Last Post: kowshik
  How import final calculated values by cell formula from Excel not the formula itself. qtped 1 4,839 01-17-2017, 04:05 PM
Last Post: sagar.raythatha
  Not able to set value in application web edit box tanuj dewangan 4 3,659 07-29-2016, 03:58 PM
Last Post: harshadevadas

Forum Jump:


Users browsing this thread: 2 Guest(s)