Watir,我如何获取运行测试脚本后显示的错误并将其放在文件中

发布于 2024-09-28 09:18:36 字数 82 浏览 4 评论 0原文

我对 Watir 和运行脚本很陌生。只是想问我如何获取或提取 Scite 显示在左侧面板上的错误消息并将其导入到文本文件中?或者真的可以做到吗?谢谢。

Im new to watir and running scripts from it. Just want to ask if how can I get or extract the error messages Scite displays on the left panel and import it to a textfile? or is it really possible to do? Thanks.

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

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

发布评论

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

评论(2

一抹苦笑 2024-10-05 09:18:36

我不确定你会如何从 Scite 执行此操作,但如果你从命令行执行 Watir 脚本,你可以将输出重定向到文件:

$ ruby watir_script.rb > results.txt

如果你使用像 RSpec,有很多用于将测试结果存储在文件中的选项。

I am not sure how would you do it from Scite, but if you execute Watir script from command line, you can redirect output to file:

$ ruby watir_script.rb > results.txt

If you use test framework like RSpec, there are a lot of options for storing test results in files.

ゝ杯具 2024-10-05 09:18:36

在 Scite 中,单击输出框架,按 Ctrl-A(选择全部)、Ctrl-C(复制),然后粘贴到您喜欢的每个应用程序(例如记事本)中。

我同意 Zeljko 的观点,你应该使用像 rspec 或 testunit 这样的好的框架。祝你好运。

From Scite, you click in the output frame, Ctrl-A (to select all), Ctrl-C (to copy), then paste into what every application you like such as notepad.

I agree with Zeljko, you should use a good framework like rspec or testunit. Goodluck.

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