• 0

Selenium and xpath - locate an element using class attribute

Issue : Locate the following element using its Class.

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

Resolution : You can write the following query in the browser console.

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

Further Reading