I am trying to test a dropdown list using karate. The ID is dynamic(changes every time you load). The class is used on 3 other dropdown list. It has no name. Its title is used on every dropdown list.
This is what I am given
\<select id="field-:r3t:" required="" aria-required="true"
class="chakra-select css-65cg11"\>\<option value="" disabled=""
selected=""\>Select a condition\</option\>
\<option value="New"\>New\</option\>\<option value="Used"\>Used\
</option\>\<option value="Broken"\>Broken\</option\>\</select\>
I first tried to select('#field-:r3t:','New')
which failed because the ID changes every load.
I then tried to select(.css-65cg11','New')
which passed but because it is not the first drop down using that class, it did not change the selection for the drop down I wanted to test.
Lastly I tried to select('{}Select a condition', 'New')
which failed