This repository has been archived by the owner on Sep 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Working with lists
Cezary Piątek edited this page Jan 31, 2017
·
9 revisions
To simplify working with list there is a special wrapper called WebList. A list could be any html element which has collection of items (for example ul with li elements, table with tr, or even div with directly nested inner divs.
To create WebList wrapper from element with given id use code as follows
var list = browserAdapter.GetListWithId("SampleList");
You can also convert an existing element (IPageFragment) to list using ToWebList() method. When you have WebList instance, you can access items using indexer notation
list[1] //access second child
or one of special methods
list.first() //access first child
list.last() //access last child
list.FindItemWithText("Example child") //access child containing text 'Example child'
To get number of items use Count property.