简体   繁体   English

使用Java的对象间谍

[英]Object Spy using Java

I am working on a project in Java where I should be able to launch a site and then recognize a browser Web Elements with a Mouse Over, like the Object Spy in QTP. 我正在Java中的一个项目上工作,在那里我应该能够启动一个站点,然后用鼠标悬停识别浏览器Web元素,例如QTP中的Object Spy。 The Elements that I hope to get are Name, Class Name, ID, Tagname, Linktext,Partial LinkText, CSS Xpath..etc.. 我希望获得的元素是名称,类名,ID,标记名,Linktext,部分LinkText,CSS Xpath..etc。

I am kind of lost on how to bridge the Browser and the Application.Can anyone help? 我对如何桥接浏览器和应用程序有点迷茫,有人可以帮忙吗?

Thank you in Advance. 先感谢您。

Inject a javascript/Jquery code into the web page to capture element properties. 将javascript / jquery代码注入网页以捕获元素属性。 You can pass the element back to Java class and catch it in a org.w3c.dom.HTMLElement object. 您可以将元素传递回Java类,并将其捕获在org.w3c.dom.HTMLElement对象中。 Using the methods in the object, you can retrieve all the attributes corresponding to the Element . 使用对象中的方法,您可以检索与Element对应的所有属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM