Reputation: 11
I need to select the first div element whose classes match the style-[0-9]+ classB
pattern.
e.g.:
<div class="style-123 classB">Div1</div>
<div class="style-235 classB">Div2</div>
<div class="style-173 classB">Div3</div>
The Div1
div should be selected in this example.
How to do that in TestCafe?
Upvotes: 1
Views: 216
Reputation: 172
Selector('div').withAttribute('class', /style-[0-9]+ classB/)
Upvotes: 2