Forum Discussion
Bharadwaj
Contributor
Hi,
You wont be able to use a search pattern in this case as className property does not exist in any of the search patterns. The work around for this is as below
IEnumerable<IWebElement> panelObjects = page.FindAll<IWebElement>(new WebCellElementPattern { objectType = "Panel" }, 1000,3000) IWebObject myPanelObject = panelObjects.Where(l => l.GetProperty<string>("className").Contains("yourclassname"))
You can filter the object with class name you want using LINQ on the collection
panelObjects
.
sergi
7 years agoContributor
Thanks for the suggestion.
I was looking for something more straightforward and less like a workaround, but I've already had to do this in other use cases.
Related Content
- 12 years ago
Recent Discussions
- 27 days ago
How to compare images?
Solved2 years ago- 5 months ago
- 10 months ago