如何使用selenium RC测量网页中元素的位置?
我已经尝试了很多方法来找出如何在不同的浏览器中测量网页中元素的坐标。但我找不到任何解决方案。
有没有其他工具可以测量元素在各种浏览器中的位置???
I have tried a lot in finding out how measure the coordinate of an element in a web page in different browser.But I could not find any solution.
Is there any other tool that can measure the position of an element in various browsers???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 AutoIt 中,您可以使用以下代码来获取屏幕坐标(在我的示例中,用于在 Internet Explorer 上将工具提示显示为覆盖层):
或者您可以使用
_IEGetObjById($oIE, "mx77")
获取对象引用。或者按标签名称遍历所有元素,如此处所示。您可以使用以下方法获取浏览器内位置,而不是获取绝对屏幕位置
browserx
和browsery
。In AutoIt you can use the following code to get screen coordinates (in my example for displaying a tool tip as an overlay on an Internet Explorer):
Alternatively you can use
_IEGetObjById($oIE, "mx77")
to get an object reference. Or run through all all elemnts by tag name as shown here.Instead of getting the absolute screen position, you can get the In-Browser-Position, using
browserx
andbrowsery
.