0
I am trying to create a tool that will get All objects from a webpage including its valid xpaths.

For example:

In a Login Page where the following objects are usually seen:

username textbox
password textbox
login button
cancel button

It will return all these objects together with their respective XPATHs.

OR at least if you click the Object then the tool will get the Object and its corresponding XPATH,


Is this even possible? Appreciate your feedback, Thank you.
Toshi
  • 71
  • 1
  • 10

1 Answers1

0

Open browser console and type this:

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

now click on any element and check console - your element will be printed. So sure it could be done)

You can also check these articles:

I'm storing click coordinates in my db and then reloading them later and showing them on the site where the click happened, how do I make sure it loads in the same place?

Get unique selector of element in Jquery

Get element's CSS selector (when it doesn't have an id)

Vitaliy Moskalyuk
  • 2,463
  • 13
  • 15
  • Thank you for your response. Is this done in VBA or Java? – Toshi Oct 20 '17 at 15:56
  • it could be done with JavaScript, etc, or like browser plugin) I think it's really bad idea to make it as a standalone application or in any another way) but I hope somebody will make better suggestion) this info is just FYI, not expecting to be correct answer – Vitaliy Moskalyuk Oct 20 '17 at 16:00