I retrieve a list of elements from a page using:
var elements = Driver.FindElements(locator)
I want to remove all the list items in elements that contain a particular text attribute "testing"
I believe it will be something like:
var elements = Driver.FindElements(locator).Remove(...)
CodePudding user response:
You can use RemoveAll
with a lambda expression to remove all the elements with matching text
elements.RemoveAll(el => el.Text == "testing");