简体   繁体   English

创建测试自动化套件即服务的最佳方法是什么

[英]What is the best way to create a test automation suite as a service

I am trying to create the following setup : 我正在尝试创建以下设置:

  1. A Selenium (Java) project that has a set of 10 automated test cases. 一个Selenium(Java)项目,具有一组10个自动化测试用例。
  2. When this project is executed, it generates an HTML test execution report. 执行此项目时,它将生成HTML测试执行报告。
  3. This project should be 'hosted' on an internal network. 该项目应“托管”在内部网络上。
  4. Anyone who has access to the network should be able to 'invoke' this project, which in turn executes the test cases and passes the HTML report to the person who invoked it. 有权访问网络的任何人都应该能够“调用”此项目,该项目又执行测试用例,并将HTML报告传递给调用它的人。
  5. The project should be accessible ONLY for execution and the code should NOT be accessible. 该项目应仅可访问才能执行,并且代码不可访问。

My goal is that this implementation should be executable by any framework irrespective of the technology that the framework uses. 我的目标是,无论框架使用何种技术,该实现都应可由任何框架执行。 I was thinking of creating the project as a WebService using Java (servlet). 我当时正在考虑使用Java(servlet)将项目创建为Web服务。

My question is: 我的问题是:

  1. Can this implementation be accessed by any external automation framework ? 任何外部自动化框架都可以访问此实现吗?
  2. Are there any limitations to this implementation? 此实现是否有任何限制?
  3. Is there a better way to implement this requirement? 有没有更好的方法来实现此要求?

Thanks in advance. 提前致谢。

You can create a maven project and have your automated tests under maven test folder.Configure your tests to run through POM.xml(use maven surefire plugin).Configure a jenkins job to run the maven test.Anybody with access the jenkins can build/run this task! 您可以创建一个maven项目并在maven测试文件夹下进行自动化测试。将您的测试配置为通过POM.xml运行(使用maven surefire插件)。配置一个jenkins作业以运行该maven测试。任何有权访问jenkins的人都可以构建/运行此任务!

Below link should give you a headstart http://learn-automation.com/selenium-integration-with-jenkins/ 下面的链接应该为您提供领先的机会http://learn-automation.com/selenium-integration-with-jenkins/

As a matter of fact, it is something we did on one of our projects. 事实上,这是我们在一个项目中所做的。 As I cannot share specifics, I will give you overall architectural view of the project. 由于无法共享细节,因此我将为您提供该项目的总体架构视图。

The core of all things was a service that could run JUnit tests on requests. 万物的核心是可以对请求运行JUnit测试的服务。 It was a Soap web-service, but nothing stops you from making it REST. 这是一个Soap网络服务,但是没有什么可以阻止您使其成为REST。 To implement this you need to implement your version of JUnit test runners (see for example: http://www.mscharhag.com/java/understanding-junits-runner-architecture or https://github.com/junit-team/junit4/wiki/Test-runners ) 要实现这一点,您需要实现您的JUnit测试运行程序的版本(例如,请参见: http : //www.mscharhag.com/java/understanding-junits-runner-architecturehttps://github.com/junit-team/ junit4 / wiki / Test-runners

If you use JUnit as test framework for running your Selenuim tests this may be a great solution for you - JUnit will generate HTML reports for you if you configure it properly, it will hide actual test suite implementation from users and run test suite on demand. 如果将JUnit用作运行Selenuim测试的测试框架,那么这可能是一个不错的解决方案-如果配置正确,JUnit将为您生成HTML报告,它将对用户隐藏实际的测试套件实现,并按需运行测试套件。 This solution is also great because it operates on JUnit level and does not care about what kind of tests it actually runs, so it can be also reused for any other kind of automated tests. 该解决方案也很棒,因为它在JUnit级别上运行,并且不关心它实际运行的是哪种测试,因此它也可以重用于任何其他类型的自动化测试。

So to answer all your questions: 因此,回答所有问题:

Can this implementation be accessed by any external automation framework ? 任何外部自动化框架都可以访问此实现吗? -> yes, it can be accessed by anybody who able send http requests ->是的,任何能够发送http请求的人都可以访问它

Are there any limitations to this implementation? 此实现是否有任何限制? -> none that I am aware of ->我不知道的

Is there a better way to implement this requirement? 有没有更好的方法来实现此要求? -> well, I didn't actually work with TestNG much so I don't know if it is easier or more difficult to do it on Junit level. ->好吧,我实际上并没有过多地使用TestNG,所以我不知道在Junit级别上做起来更容易或更困难。 You can use Jenkins or other CI tool as well to achieve same results - they can run JUnit tests for you and almost always have API ready for this, although those APIs may be not perfect. 您也可以使用Jenkins或其他CI工具获得相同的结果-它们可以为您运行JUnit测试,并且几乎总是为此准备好API,尽管这些API可能并不完美。

So I'd say that if you need this only for one thing you can use CI tools for this purpose, if you don't have CI tools available then choice has been made for you. 因此,我想说的是,如果您只需要一件事情,就可以使用CI工具,如果您没有CI工具,那么您就可以选择了。 However, from our experience, having this kind of service was a great asset for a company and I really wonder why there's no such products available elsewhere yet. 但是,根据我们的经验,提供这种服务对公司来说是一笔巨大的财富,我真的很奇怪为什么在其他地方还没有这样的产品。

暂无
暂无

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

相关问题 有没有办法在我的测试自动化套件目录中自动更新 chromedriver? - Is there a way to automatically update chromedriver in my Test Automation Suite directory? 在Eclipse中自动化生成测试套件 - Automation of test suite generation in eclipse 为isSorted()方法创建JUnit测试用例的最佳方法是什么? - What is the best way to create a JUnit test case for the isSorted() method? 向JUnit Test Suite提供输入的普遍接受的方式是什么 - What is the universally accepted way to provide inputs to JUnit Test Suite 在自动化中存储执行期间使用的 sql 查询的最佳方法是什么 - What is the best way to store the sql queries used during execution in Automation Selenium 自动化:在运行测试套件时,除了有效失败之外,可接受的失败测试用例范围应该是多少? - Selenium Automation: What should be the acceptable range of failed test cases apart from the valid fails when running a test suite? 在java中测试REST服务的最佳方法 - Best way to test a REST service in java 测试这个的最佳方法是什么? 具有4个位置的二进制数字 - What is the best way to test this? Binary digits with 4 positions 使用JUnit测试控制器和服务的最佳方法是什么? - What is the best way to test Controllers and Services with JUnit? 使用 JUnit 测试构造函数(或 setter)的最佳方法是什么? - What is the best way to test constructor (or setters) with JUnit?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM