简体   繁体   English

Selenium-Webdriver- Java + TestNg与红宝石

[英]Selenium-Webdriver- java+TestNg Vs ruby

I have a automation suite in selenium-webdriver ruby::TestUnit. 我在selenium-webdriver ruby​​ :: TestUnit中有一个自动化套件。 I found that in java, we can have TestNg, which provides many facilities. 我发现在Java中,我们可以拥有TestNg,它提供了许多功能。 Is it worthwhile to change all my suite to java+TestNg? 将我的所有套件都更改为java + TestNg是否值得? or Should I implement them myself in ruby? 还是我应该自己用红宝石实现它们? in particular, I am looking for these features.. data-driven, page object based , comprehensive reports 特别是,我正在寻找这些功能。.数据驱动,基于页面对象的综合报告

I highly recommend to try Capybara before you move on to Java: 我强烈建议您在尝试使用Java之前尝试Capybara

https://github.com/jnicklas/capybara https://github.com/jnicklas/capybara

Both has its own merits and demerits 两者都有其优点和缺点

Java selenium :help will be available online if you stuck up somewhere more APIs will be available for any integration 如果您遇到其他麻烦,可以使用Java selenium:help联机获取更多信息

Ruby Selenium :less help will be available online ,as users are quite smaller in numbers Ruby gems are limited for any type of integration Ruby Selenium:由于用户数量很少,因此在线提供的帮助会越来越少,因为Ruby gems仅限于任何类型的集成

Ruby is very simple and easy Language If your project can be rated as medium or Low in terms of complexity ,I would prefer to use Ruby. Ruby是非常简单易用的语言如果您的项目在复杂性方面可以评为中级或低级,那么我宁愿使用Ruby。

You can use Rspec(BDD tool) in place of Test NG (set up annotation, test flow/order, etc). 您可以使用Rspec(BDD工具)代替Test NG(设置批注,测试流程/顺序等)。 You can also use page-object-gem to categorize each functional page into a class. 您还可以使用page-object-gem将每个功能页面分类为一个类。 Page-object-gem for Ruby is far more powerful than the page object model used in Java. Ruby的Page-object-gem比Java中使用的页面对象模型强大得多。 This is an API that comes with 3-5 methods (.click, getAttribute, select the radio button, check/uncheck checkbox, etc) when you declare the element using a locator (whereas in Java, the developer has to code all of these methods themselves). 当您使用定位符声明元素时,这是一个包含3-5种方法(.click,getAttribute,单选按钮,选中/取消选中复选框等)的API(而在Java中,开发人员必须对所有这些方法进行编码方法本身)。 I've moved my project from using selenium java to selenium/watir/rspec/page-object-gem, we cut down the lines of code by three folds. 我已将项目从使用selenium java移至selenium / watir / rspec / page-object-gem,我们将代码行减少了三倍。 The team can accomplish a lot more stories in a sprint comparing before. 与以前相比,团队可以在sprint中完成更多故事。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM