2017-10-20 24 views
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. 

Répondre

0

console Ouvrir le navigateur et tapez ceci:

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

maintenant cliquer sur un élément et vérifiez console - votre élément sera imprimé. Alors que cela pourrait être fait)

Vous pouvez également consulter ces 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)

+0

Merci pour votre réponse. Est-ce fait en VBA ou Java? – Toshi

+0

il pourrait être fait avec JavaScript, etc, ou comme plugin de navigateur) Je pense que c'est vraiment une mauvaise idée de le faire en tant qu'application autonome ou d'une autre manière) mais j'espère que quelqu'un fera mieux suggestion) cette info est juste FYI, pas s'attendant à être la réponse correcte –