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

回答

0

打開瀏覽器控制檯,輸入:

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

現在點擊任何元素,並檢查控制檯 - 你的元素將被打印。因此,確保它可以做)

您還可以查看這些文章:

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

謝謝您的答覆。這是在VBA還是Java中完成的? – Toshi

+0

它可以用JavaScript等來完成,或者像瀏覽器插件一樣)我認爲把它作爲一個獨立的應用程序或以任何其他方式做它是一個非常糟糕的主意),但我希望有人會提出更好的建議)這個信息只是供參考,而不是期待是正確的答案 –