为什么我们使用 WebDriver 而不是 Selenium IDE? [英] Why do we use WebDriver instead of Selenium IDE?

查看:19
本文介绍了为什么我们使用 WebDriver 而不是 Selenium IDE?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我们不能在 Selenium IDE 中记录我们所有的测试用例,将其导出到 Java/WebDriver 并使用 Eclipse 在 WebDriver 中运行它?

Why can't we just record all of our test cases in Selenium IDE, export it to Java/WebDriver and run it in WebDriver with Eclipse?

我需要一个明确的解释,因为我对使用 WebDriver 很困惑!

I need a clear explanation as I am very much confused in using WebDriver!

谁能解释为什么 IDE 录制的脚本在 WebDriver 中失败?

And can anyone please explain why IDE recorded scripts fail in WebDriver?

推荐答案

为什么我们不能在 IDE 中记录所有测试用例,将其导出到 java/webdriver 并在 webdriver 中运行

why cant we just record all of our test cases in IDE, export it to java/webdriver and run it in webdriver

很好的问题,这是答案:

Great question, and here is the answer:

Selenium IDE 是一个录制和播放工具,非常好用,但非常不可靠.记录和回放在 Web 应用程序中通常是不受欢迎的.由于 Web 应用程序经常更改,因此 IDE 不是生产环境的理想解决方案,因为可能会出现维护噩梦.

Selenium IDE is a Record and Playback tool, which is very easy to use, but it's very unreliable. Record and playback is typically a frowned upon in web applications. Since web applications are frequently changed, the IDE is not an ideal solution for a production environment, because of the maintenance nightmare that may arise.

让我给你一个实际的例子.您记录您的测试,并找到具有动态 ID 的元素.当然我们可以将它导入 eclipse,但是当测试开始失败时会发生什么?为什么不简单地让您的测试变得敏捷和独立,以便在第一时间捕捉到这些问题.

Let me give you a practical example. You record your test, and you find an element with a dynamic ID. Sure we can import it into eclipse, but what happens when that test starts failing down the road? why not simply make your test agile and independent to catch these in the first place.

这也归结为您的测试自动化原则.在我看来(和其他几位专业人士)测试自动化认为应该从编程的角度来处理测试自动化.程序员应该编写测试并维护测试.理想情况下,您的质量保证人员应接受培训,以编写和维护他们自己的测试.

It also boils down to your principles of test automation. Test automation in MY opinion (and several other professionals), believe that test automation should be approached from a programming perspective. Programmers should write the tests, and maintain the tests. Ideally, your quality assurance personnel should be trained to write and maintain their own tests.

再次回到您的问题,IDE 旨在成为自动化的快速解决方案,而不是完整回归套件的解决方案.

So again, back to your question, the IDE is designed to be a quick solution to automation, NOT a solution to a full regression suite.

谁能解释一下为什么 IDE 录制的脚本在 Webdriver 中失败?

And can anyone please explain why IDE recorded scripts fail in Webdriver?

我有一段时间没有使用IDE,但它们失败的原因是因为导出的脚本只是步骤,而不是整个java文件.这也是因为 Selenium IDE 导出在如何运行测试时应该是不可知的.假设我是 jUnit 的用户.如果 Selenium IDE 一直将它导出到 TestNG 会怎样?这不公平.. 老实说,我宁愿创建自己的测试,也不愿每次创建测试文件时都更改那一行.

I haven't used the IDE in a while, but the reason they fail, is because the scripts that are exported, are simply the steps, not an entire java file. This also is because Selenium IDE exportations are supposed to be agnostic when it comes to how to run your test. Say I'm a user of jUnit.. what if Selenium IDE exported it to TestNG all the time? That wouldn't be fair.. honestly i'd rather create my own tests than changing that one line every single time i create my test file.

您可以阅读一项名为 为什么要记录/重放的研究的全文测试Web 应用程序中断?

这篇关于为什么我们使用 WebDriver 而不是 Selenium IDE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆