We're planning to automate test synchronization between HP ALM QC and our TestNG test cases. We want to keep them synced in the following scenarios:

  • Test adding: When creating TestNG test, a test should be created in HP QC
  • Test execution: When executing TestNG test, a test instance with status should be created in HP QC
  • Refactoring: Name and directory of TestNG test should correspond to name and directory of the test in HP QC. So when refactoring a Java class test (i.e., renaming a class or moving between packages),

So we were thinking about different approaches, each having some tradeoff

  • Approach #1: Each time a dev creates a new test, calls maven plugin to add a test to HP QC and then add @QCTestId annotation with testId to the test class source code. Then it commits the class. Each time a dev updates a test name/package, it runs the plugin again to update test name/package in ALM.

  • Approach #2: Similar as 1st approach, but the plugin does not update the test class source code, but adds this information to some external file/DB. When a test name/package is changed, the test with the old name is removed by the plugin from HP QC and added with a new name to HP QC.

Approach #1 looks a bit smelly to me because maven plugin is manipulating existing source code. While approach #2 has a limitation that by deleting the old test, we’re loosing also the history of test execution from HP QC.

Any other idea?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.