Search code examples
webdriver

What do these Web Driver selectors select?


What do these web driver selectors select?

get talktoSales(){return $("(//div)[56]")} 
get popUpclick() {return $("//div[@class='spu-container']")} 

Thank you.


Solution

  • Without the link to the webiste it would be difficult to point to the exact element selected by these selectors.

    The first selector "(//div)[56]" selects the 56th div element in the page

    The second one "//div[@class='spu-container']" selects the first div element that has the class name as 'spu-container'