Karim Narsindani
Karim Narsindani

Reputation: 454

How does firepath finds unique xpath on click

I am very curious to know how does firepath finds a unique xpath locator with in seconds as soon as we click on element. I know how to query xpath using firepath, but what I want to know that which language or technology has been used to developed such tools and what if I have to develop similar kind of tool. I have seen many automation tool have develop with such tools where when we click on page it will generate unique xpath locator, it makes me to curious and I want to know in depth how does things works in back end.

  1. When I open DOM in developer tool it was so confusing.
  2. How they identify element on click?
  3. Is it rocket science?
  4. Do they user JavaScript, JQuery or any other programing language?
  5. Do we have any apis which can be use?

Upvotes: 0

Views: 66

Answers (1)

Vitaliy Moskalyuk
Vitaliy Moskalyuk

Reputation: 2583

type this in console and click somewhere) so it's the answer

document.addEventListener('click', function(event){console.log(event.target)});

Upvotes: 0

Related Questions