YUI测试:如何用JavaScript模拟更复杂的用户操作?

发布于 2024-08-07 02:25:42 字数 218 浏览 2 评论 0原文

我有很多用 YUI Test 编写的测试。 YUI 测试在模拟用户操作方面的能力非常有限,或者说水平相当低。例如,我无法轻松模拟用户在文本字段中键入内容以及随之而来的 DOM 对象的事件和修改。

Selenium 在这方面做得更好,但 Selenium 的运行方式不同。 Selenium 或其他库中是否有代码可以调用来模拟用户的操作,例如“在此按钮中键入此文本”,并且仍将我的测试保留为 YUI 测试?

I have a number of tests written with YUI Test. YUI Test capabilities when it comes to simulating users' actions are quite limited, or rather fairly low level. For instance, I can't easily simulate the user typing in a text field, with the events and modifications to DOM objects that go with it.

This is something that Selenium does much better, but Selenium is ran in a different way. Is there code in Selenium or some other library that I could call to simulate users' actions, like "type this text in this button", and still keep my test as a YUI Test?

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

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

发布评论

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

评论(1

左岸枫 2024-08-14 02:25:42

我不认为你能够将它们保留为 YUI 测试。您可以以某种方式在测试中导入 selenium 的 js 库,并调用 browserbot 中的方法来执行您所说的复杂操作,但我更愿意保持清晰并正确创建一个 selenium 测试套件。

I don't think you'll be able to keep them as YUI tests. You could somehow import selenium's js libs in your tests and call the methods in browserbot to make those complex actions you say, but I'd prefer to keep things clear and create a selenium test suite properly.

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