Reputation: 159
I am trying to create the following setup :
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).
My question is:
Thanks in advance.
Upvotes: 0
Views: 351
Reputation: 1145
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. It was a Soap web-service, but nothing stops you from making it 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)
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. 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.
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
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. 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.
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. 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.
Upvotes: 0
Reputation: 221
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!
Below link should give you a headstart http://learn-automation.com/selenium-integration-with-jenkins/
Upvotes: 1