This is in the same vein as this question I asked before - Watir webdriver; counting elements with changing class names. I was able to add the specific number of elements based on using the class name asset-card selectable
.
Currently, I am looking to click on more elements to add them to the existing set. Here is my dilemma:
- When an element is not clicked, the class name is:
image-card asset-card selectable
- When an element is clicked,
selected
is appended to the class name:image-card asset-card selectable selected
In my case, I am trying to look for additional elements that only say image-card asset-card selectable
and do not include selected
. I am not sure how to explicitly locate them.
Is there a regex solution or any other thoughts on how to approach this?