使用 Selenium IDE 测试需要动态页面加载的内容

发布于 2024-10-07 10:40:14 字数 599 浏览 0 评论 0原文

我正在尝试创建一个测验测试。测验的工作方式如下:

  1. 单击并等待测验链接。

  2. 第一页有一个问题和单选按钮。用户单击单选按钮,然后单击并等待提交按钮。

  3. 第二页是另一个带有单选按钮的问题。用户单击单选按钮,然后单击并等待提交按钮等。

  4. N 页后,在结果页面,我想验证某些文本是否存在。

此测试的目的是:(1)用户可以从头到尾进行测验,(2)测验问题是否正确提交(提交之间没有异常),(3)用户看到预期的结果。

我知道我可以使用 Selenium RC 轻松完成此操作,但我需要在 Selenium IDE 中使用它,以便非技术人员在进行冒烟测试时只需按下按钮即可。 (我知道,质量检查应该这样做,但我不制定规则。)

我的问题是:我应该如何最好地测试具有动态数量问题的测验(我们测验页面上的测验每天都在变化)有些被禁用或从系统中删除)?

我希望在 JavaScript 中执行此操作(将脚本放入 runScript 中),但我不知道如何在脚本中执行相当于“clickAndWait”的操作,因此我无法进行提交。

顺便说一句,我是 JavaScript 新手。

I'm trying to create a test for a quiz. The quiz works like this:

  1. Click and wait on the quiz link.

  2. First page has a question and radio buttons. User clicks on a radio button, then clicks and waits on the submit button.

  3. Second page is another question with radio buttons. User clicks on a radio button, then clicks and waits on the submit button, etc.

  4. After N pages, at the results page, I want to verify that some text exists.

The purposes of this test are: (1) that the user can take a quiz all the way to the end, (2) quiz questions are submitting properly (no exceptions between submissions), (3) the user sees the expected results.

I know that I can do this easily with Selenium RC, but I need this is in Selenium IDE so that non-technical people can just press a button when they are doing a smoke test. (I know, QA is supposed to do this, but I don't make the rules.)

My question is: how should I best test a quiz with a dynamic number of questions (quizzes featured on our quiz page vary from day to day and some get disabled or deleted from the system)?

I'm looking to do this in JavaScript (putting the script in runScript), but I can't figure out how to do the equivalent of "clickAndWait" within the script, so I can't do a submit.

I'm new to JavaScript, btw.

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

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

发布评论

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

评论(1

救星 2024-10-14 10:40:14

博客文章描述了有关同样的事情...

blog post describing about the same thing...

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