I can have multiple AccountListItem in my project which shows account data in it. Each accountListItem contains PlatformName text, URL text etc.
So as a solution I chose to have AccountListItem as rooted folder and inside it all the items related to accounts(see screenshot).
When I have multiple accounts Spy shows that multiple elements have been found for this rooted folder. Now I want to iterate over all the accounts I have and access items under it, smth like this described in code below:
Code: Select all
IList<AccountListItemFolder> thisAccountList = repo.Accounts.AccountListItem;
foreach(AccountListItemFolder account in thisAccountList)
{
Report.Info(account.PlatformNameLbl.TextValue);
}
I tried many different ways for casting but it doesn't work.
And if I try
Code: Select all
IList<ListItem> a = Host.Local.Find<ListItem>(repo.Accounts.AccountListItem.AbsoluteBasePath);
foreach(ListItem account in a)
{
account.Click();
}
and last point, I also tried this code:
Code: Select all
IList<AccountListItemFolder> a = Host.Local.Find<AccountListItemFolder>(repo.Accounts.AccountListItem.AbsoluteBasePath);
Has anyone of you solved this kind of problem? How can I iterate over rooted folder?