This is a migrated thread and some comments may be shown as answers.

Retrive the weblist items during run time

1 Answer 11 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chandrasekhar
Top achievements
Rank 1
Chandrasekhar asked on 30 Apr 2013, 09:41 AM
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

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 30 Apr 2013, 12:09 PM
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
Tags
General Discussions
Asked by
Chandrasekhar
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or