Question

Please guide me through the steps on setting up TeamCity so that it can run my TestNG tests.

My Objective: Whenever I run a new build on TeamCity, it should automatically trigger my testNG suite on the new build.

I am using the following tools:
IDE: Eclipse
Automation Tool: Selenium Webdriver
Language: Java
Test Runner Framework: TestNG

Any reference to link or website would be very helpful.

Was it helpful?

Solution

You should integrate ANT in your selenium+TestNG framework so that you can run the tests from a build script. Plus, TeamCity's docs say that

TeamCity directly supports the following testing frameworks:

JUnit and TestNG for the following runners: Ant (when tests are run by the junit and testng tasks directly within the script)

Some links:
Apache ANT
ANT Tutorial
TestNG with ANT

So once you create your build script in build.xml file which should lie in your framework's root folder, you should configure your build job and add a build step (with an ANT build runner) in TeamCity to run this build.xml after TeamCity finishes building/deploying the app. You can do that by specifying a step execution policy for the ANT build step.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top