我可以使用 Selenium 访问 DOM 对象吗?

发布于 2024-07-15 08:12:20 字数 87 浏览 3 评论 0原文

我来自 QuickTest Pro 背景,我可以使用 .object 方法获取任何元素的 DOM 对象。 我想知道 Selenium RC 中的等效项是什么。

I am coming from a QuickTest Pro background where I can get to any element's DOM object with the .object method. I want to know what the equivalent is in Selenium RC.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半衾梦 2024-07-22 08:12:20

你当然可以。 真正的问题是:你想用它做什么? 查看 getEval() 命令。 它可以评估任何 JavaScript 并以字符串格式返回结果。 这意味着您无法将完整的 DOM 对象返回到 Java/C#/perl/etc 中,但您可以返回它的属性(即:innerHTML 等)。

Sure you can. The real question is: what do you want to do with it? Check out the getEval() command. It can evaluate any JavaScript and return the result in a String format. That means you can't get the full DOM object back in to Java/C#/perl/etc, but you can get back attributes of it (ie: innerHTML, etc).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文