Active/non-active class - how to identify?

I am using the below attributes :

To click on one of the following options given:

How can I handle the fact that ‘class’ changes for the activated option? How to select the ‘-0.5 mm’ option here, no matter if activated or not.

Thanks in advance,



You can use xpath selector

//span[contains(., '-0.5 mm')]

Thank you for the answer, using your suggestion

//span[contains(., ‘-0.5 mm’)]

selects the first option ‘-1 mm’ instead of ‘-0.5 mm’

Using (tabindex = 6, text = ‘0.5 mm’) in the attributes tab works, but I still would like to know how to express that as a xpath selector, or how to get your solution going

If you are able to use CSS and if you are able to select based on dom structure position, then you could use CSS like this:

span.option-note-options span:nth-child[2]

But I suspect you want to select by text content, i.e. -0.5

try either:
//span[contains(., ‘-0.5 mm’)][not(contains(@class,‘option-note-options’))]


//span[contains(@class,‘option-note-options’)]/span[contains(., ‘-0.5 mm’)]

The problem is the parent span element beeing selected first when using //span[contains(., ‘-0.5 mm’)]

or better
//span[text()=’-0.5 mm’][not(contains(@class,‘option-note-options’))]

//span[contains(@class,‘option-note-options’)]/span[text()=’-0.5 mm’]

as otherwise the xpath is not unique when using the value ‘0.5 mm’