WebdriverIO 与 Selenium Webdriver(Java 方法)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/35632956/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
WebdriverIO Vs Selenium Webdriver (Java Approach)
提问by user3559569
Any feedback on WebdriverIO vs Selenium with Java? I am in a dilemma and wanted to clear up this confusion.
关于 WebdriverIO 与 Selenium with Java 的任何反馈?我处于进退两难的境地,想澄清这种困惑。
I have spent a few days learning WebdriverIO and also did some hands-on but reached the conclusion that it is not mature enough. Debugging is really a challenge.
花了几天时间学习WebdriverIO,也做了一些动手,但得出的结论是它不够成熟。调试确实是一个挑战。
回答by Andrew Regan
WebdriverIOis a JavaScript / nodejs implementation of the (Selenium 2.0) WebDriver API - one of many (Selendroid, Protractor, etc.) As the specificationsays:
WebdriverIO是(Selenium 2.0)WebDriver API 的 JavaScript / nodejs 实现 - 众多(Selendroid、Protractor 等)之一,正如规范所说:
WebDriver is a remote control interfacethat enables introspection and control of user agents. It provides a platform- and language-neutral wire protocol as a way for out-of-process programs to remotely instruct the behaviour of web browsers.
WebDriver 是一个远程控制界面,可以对用户代理进行自省和控制。它提供了一种与平台和语言无关的有线协议,作为进程外程序远程指导 Web 浏览器行为的一种方式。
If you use Java, you'll use the Java implementation of WebDriver. Which language, and which implementationyou choose, is up to you, your skills, and the skill of your team.
如果您使用 Java,您将使用WebDriver的Java 实现。您选择哪种语言和实现方式取决于您、您的技能和您团队的技能。
Though I very much doubt that WebdriverIO is "not mature enough". WebDriver is a fine spec, with a number of powerful implementations, but it is very frequently misused. Certainly as far as newbies go, a very large proportion of "random" failures are completely avoidable race conditions within their test code.
虽然我非常怀疑 WebdriverIO “不够成熟”。WebDriver 是一个很好的规范,具有许多强大的实现,但它经常被误用。当然,就新手而言,很大一部分“随机”失败在他们的测试代码中是完全可以避免的竞争条件。
回答by Marek
So we are using a Java - Selenium, Serenity, JBehave test framework and then the Javascript WebdriverIO, Mocha, and Yodda.
所以我们使用 Java - Selenium、Serenity、JBehave 测试框架,然后是 Javascript WebdriverIO、Mocha 和 Yodda。
I think the Java approach is easier to understand and debug. Easier to understand because website testing is mostly sequential, you navigate from one page to another, click on a button, and fill out a form. It saves you from any async issues you run into using the JS alternative. Debugging is very nice because you have classes and a fixed structure to everything.
我认为Java方法更容易理解和调试。更容易理解,因为网站测试大多是连续的,你从一个页面导航到另一个页面,点击一个按钮,然后填写一张表格。它使您免于使用 JS 替代方案遇到的任何异步问题。调试非常好,因为你有所有的类和固定的结构。
The second project uses NodeJS in the backend so integrating the testing framework was alot easier. The testing framework became part of the deployment/development process.
第二个项目在后端使用 NodeJS,因此集成测试框架要容易得多。测试框架成为部署/开发过程的一部分。