0

I run my test using Java, Selenium and TestNG.

When I execute my test suite I have it set up where the testng.xml has all the configurations to run my tests. I am wondering, if I can set up some UI component that does the same thing as the xml?

I am asking because I have nontechnical people in my staff and I don't want them to have to download an IDE, check out the project, etc. I want to create some UI where they can just go there and hit a button and the tests runs just like how I can right click on the testng.xml and hit run.

3 Answers 3

3

You can use Jenkins to kick off your testng tests through an interface. Setup your build to execute something like this as a windows batch command:

D:>java -cp "Pathtolibfolder\lib\*;Pathtobinfolder\bin" org.testng.TestNG testng.xml

This will kick off your specific testng test using the parameters you have setup in your testng.xml. Once it is setup correctly it is very easy for non-technical people to run a build through the jenkins interface after a quick lesson.

0
1

You can always build a custom site that ties into the test code behind the scenes. Yes this requires programming knowledge, but it puts a gui on the front end that makes it easy for your team to utilize. I designed and help build one for a company I worked for. If you don't want to build your own, you are pretty much limited to the IDE gui or other tools that already handle selenium.

You can abstract the tests and still utilize the unit test framework to kick off tests and test suites. That may make it easier for your team to utilize without having to develop a custom site. You basically make test suites that call tests from within the test and keep the other things under the hood in other classes. Essentially that hides alot of the complex stuff from the user via encapsulation and then they only have to focus on certain parts that are more user friendly.

Or, find another product that does what you want an imports Selenium tests...

4
  • Is there any references you can point out to build my own custom automation UI component?
    – robben
    Commented Mar 14, 2017 at 13:44
  • I usually follow a development model as it would be custom code development unless you utilize a pre-existing one. Check out stackoverflow.com/questions/667781/… it really depends on your own preferences and the user set you are targeting. Usually a website is easy for testers to understand and so long as you create logical connection between the GUI components and the underlying automated test components. Happy to help more, but it's a wide open area the approach is based on the specifics of your needs.
    – mutt
    Commented Mar 14, 2017 at 15:19
  • I just really want a very simple interface that is essentially just a button you press and it runs your automation. I can create the UI but not sure how to connect my testng test cases to the UI.
    – robben
    Commented Mar 14, 2017 at 15:23
  • so it's just code. your tests are classes/methods with the header for the unit test harness on there. Basically you need to call those methods from the gui button calls. Frankly I like spitting out html results instead of just the unit test as I can put more details for each step in there. I basically create a custom html output and a log for each step that appends and then spit out the logged results into the html generation and put it into a folder for the user. That way they click the button and check the folder for the results and don't have to look at code or IDEs
    – mutt
    Commented Mar 14, 2017 at 19:08
0

consider using maven for this. you can run maven commands from the local directory, build in something like allure reporting and you can easily have your tests running by someone non technical via a simple .bat file or whatever with a nicely presented HTML generated report by running "mvn:test"

There are a few pre-reqs:

allure reporting dependencies

testclass names ending in Test (fully configurable in the pom.xml)

maven-surefire-plugin

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.