Retrive the weblist items during run time

2 posts, 0 answers
  1. Chandrasekhar
    Chandrasekhar avatar
    7 posts
    Member since:
    Apr 2013

    Posted 30 Apr 2013 Link to this post

    Hi All,

    How to retrive the web list items from the application under test.

    in QTP browser("browsername").Page("pagename").weblist("listname").getroproperty("items")
    the above code will bring all the list box items available in the application

    Pls provide simillar code in telerik


    Thanks,
    Chandra
  2. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 30 Apr 2013 Link to this post

    Hi Chandra,

    Here's a sample code you can use to get a collection of all list items seen on the page:

    IList<HtmlListItem> items = Manager.ActiveBrowser.Find.AllByTagName<HtmlListItem>("li");
     
    //Log the text of all items
    foreach (HtmlListItem item in items)
    {
        Log.WriteLine(item.InnerText);
    }


    Regards,
    Plamen
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top