在selenium ide中存储html源或变量内容?

发布于 2024-09-25 10:56:32 字数 205 浏览 0 评论 0原文

我正在尝试在 selenium ide 中构建一个宏,将页面源存储到文件中。我看到有一个命令 storeHtmlSource() 将页面源存储到变量,但我不知道如何将变量的内容存储到文件。有没有一些直接的方法可以做到这一点,或者我需要以某种方式让它执行 javascript 来做到这一点?

如果这还不是很明显的话,我对硒是完全陌生的,但我已经浏览了文档一段时间,但还没有弄清楚。

I am trying to build a macro in selenium ide that stores the page source to a file. I see there is a command storeHtmlSource() that stores the page source to a variable, but I can't figure out how to store the contents of the variable to a file. Is there some direct way to do this or do I need to somehow have it execute javascript to do that?

I am totally new to selenium if that was not already obvious, but I have looked around the docs for a while and haven't figured it out.

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

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

发布评论

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

评论(1

飞烟轻若梦 2024-10-02 10:56:32

不幸的是,您无法使用 Selenium IDE 执行此操作。 IDE 并没有被设计来做这样的事情,因为 Selenium Rc 可以让你做 IDE 可以做的事情,甚至更多,因为你使用你最喜欢的语言与代理对话,然后使用该语言的能力将东西写入代理。磁盘。

该 IDE 旨在帮助您通过记录功能获取测试用例的框架,然后对其进行调整、重播以查看其工作原理,然后导出到您喜欢的语言

Unfortunately you can not do this with Selenium IDE. The IDE has not been designed to do things like this since there is Selenium Rc that allows you to do what the IDE can do and more since you use your favourite language to speak to a proxy and then use that language's ability to write things to the disk.

The IDE is designed to help you get the skeleton of a test case with the record function, you then tweak it, replay to see it works and then export to your favourite language

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