Selenium and xpath — locate an element using class attribute

Issue : Locate the fol­low­ing ele­ment using its Class.

<div class="globalContainer">
    <div>
        ...
    </div>
</div>

Res­o­lu­tion : You can write the fol­low­ing query in the browser console.

$x(//div[@class="globalContainer"])

Fur­ther Reading

You may also like...