Please how can I get element by class attribute using codeceptjs & WebDriver?
This is my element, I wanna get TEST
as value
<div data-v-f0eb3906="" class="category_label pl-2 pr-2" xpath="1">TEST</div>
Any idea ?
In case the class names category_label pl-2 pr-2
are unique, you can locate this element with XPath
//div[@class='category_label pl-2 pr-2']
or with CSS selector
div.category_label.pl-2.pr-2
But if category_label pl-2 pr-2
class names are dynamically changing or not unique you will have to define locator in dependence of some parent element.