Since I’ve had so many requests (the latest being today), and since I’m working on something very similar for a current client, I decided to take some time today to respond in detail about integrating QC with JUnit & Selenium.
The steps I’ve used for Selenium / QC integration are:
2. Map your test cases to QC test cases. I described how I did this in detail by extending JUnit in these posts:
- Integrating JUnit tests with HP/Mercury Quality Center part 1
- Integrating JUnit tests with HP/Mercury Quality Center part 2
Note that this isn’t necessarily the way I’d do it now. Annotations are useful, but I think a mapping file is perhaps easier. Simply create a spreadsheet with the QC TestId in one column and the xUnit test name in another column. This is a little trickier with parameterized tests.
3. Parse the tests results from your test runner and update Quality Center using the OTA API (OTAClient.dll is installed with QC Explorer & can be downloaded from QC. Go to Help->Addins Page->HP Quality Center Client Side Setup Add-in)
I have a quick example of how to connect to Quality Center using OTAClient here:
You can check out my sample QCIntegration project on GitHub: