Results 1 to 4 of 4

Verify the weblist (drop down) items

This is a discussion on Verify the weblist (drop down) items within the QTP forums, part of the Software Testing category; I want to get weblist items and compare it with some other list Making sure that weblist populates correct data. How this should done ?...

  1. #1
    Junior Member
    Join Date
    Jan 2009
    Answers
    4

    Verify the weblist (drop down) items

    I want to get weblist items and compare it with some other list
    Making sure that weblist populates correct data.
    How this should done ?


  2. #2
    Junior Member
    Join Date
    Jan 2009
    Answers
    1

    Re: Verify the weblist (drop down) items

    ArrayList1 = Split(Browser("").Page("").WebList1("").GetRoProperty("AllItems"), ";")
    ArrayList2 = Split(Browser("").Page("").WebList2("").GetRoProperty("AllItems"), ";")

    For i = 0 to UBound(ArrayList1)

    If ArrayList1(i) = ArrayList2(i) Then
    Msgbox "PASS"
    Else
    Msgbox "Fail"
    End If
    Next


  3. #3
    Expert Member
    Join Date
    Sep 2007
    Answers
    110

    Re: Verify the weblist (drop down) items

    Hi,

    Here i am giving the script to compare the list box items with another in Flight application-
    (To run this script you have to add all the objects into the object repository)

    Window("Flight Reservation").activate
    SeltItem = window("Flight Reservation").winComboBox("Fly From:").GerROProperty("text")
    msgbox SelItem
    'It displays the selected item in the list
    ListItem = Window("Flight Reservation").WinComboBox("Fly To:").GetContent
    msgbox ListItem
    'It displays all the items in the list box
    Itemcount = window("Flight Reservation").WinComboBox("Fly To:").GerItemsCount
    msgbox Itemcount
    'It displays no of items in the list box
    For i=0 to Itemcount-1
    a=window("Flight Reservation").wincombobox("Flt To:").GetItem(i)
    If SelItem=a Then
    msgbox "Items Are Matching"
    else
    msgbox "Items Are Not Matching"
    End If
    Next

    __________________

    Thanks & Regards!!
    RAJAPUTRA

  4. #4
    Expert Member
    Join Date
    Oct 2007
    Answers
    126

    Re: Verify the weblist (drop down) items

    Hi sudhir,
    I think this is the perfect answer based on your requirement.

    ArrayList1 = Split(Browser("").Page("").WebList1("").GetRoProperty("AllItems"), ";")
    ArrayList2 = split ((arrList("item1";"item2"; ; ; ....etc)),";",-1)

    For i = 0 to UBound(ArrayList1)
    For j=0 to UBound(ArrayList2)
    If ArrayList1(i) = ArrayList2(j) Then

    Msgbox "PASS"
    Else
    Msgbox "Fail"
    End If
    Next
    Next

    Thanks and regards
    Bhaskar kumar


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact

SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.