Tagged: devtools

0

Selenium and xpath — locate an element using id attribute

Issue : Locate the fol­low­ing ele­ment using its ID. <div id=“globalContainer”> <div> … </div> </div> Res­o­lu­tion : You can write the fol­low­ing query in the browser con­sole. $x(//div[@id=“globalContainer”]) Fur­ther Read­ing xPath loca­tor Prac­ti­cal Examples