How to implement QC/ALM connection

Ask general questions here.
livelyjay
Posts: 5
Joined: Tue Feb 25, 2014 7:22 pm

How to implement QC/ALM connection

Post by livelyjay » Wed Feb 26, 2014 7:30 pm

QTP does not work with the latest version of our software as we moved from a standalone application to a web application. QTP cannot see the DOM objects, so we're investigating alternatives. Ranorex is looking like a very powerful solution, but I'm not able to wrap my head around how the QC connection is going to work within the test suite. My needs might be slightly different than others, where a "Test Step" in Ranorex will need to map back to QC where we have our requirements. I'm guessing a grouped module would be necessary to create a "Test Step". See attached image for an example.

I copied the code posted by sdaly, converted it to C#, and added a new coded module to my project. I then added code to the [Program.cs] file to create the new QCBridge object and attempt the connection to QC (message box appears stating pass/fail of the connection). So far, this appears to be working correctly.
1) Is this the correct way to set up the qcb object and connect to QC?
2) Will my test cases have access to this qcb object, or do I need to create a global parameter, which would get set to the qcb object I create?

Where do I go from here? The QCBridge object has methods for starting and stopping tests.
1) Would I put the calls to this in coded modules added to the [SETUP] and [TEARDOWN] for each and every test case?
2) How could I accomplish adding the result to the correct Quality Center Run? Would I need to create a dialog like QTP has where the tester would select the correct Run location (see attached example)?
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: How to implement QC/ALM connection

Post by Support Team » Fri Feb 28, 2014 5:45 pm

Hi livelyjay,

I am not exactly sure if this is a Ranorex issue, but have you already read the section"Running Ranorex Automated Tests with HP Quality Center" on our website?
Maybe this can help solving the issue.

Regards,
Bernhard

livelyjay
Posts: 5
Joined: Tue Feb 25, 2014 7:22 pm

Re: How to implement QC/ALM connection

Post by livelyjay » Mon Mar 03, 2014 1:49 pm

That could work, but it's not ideal for our situation. My company occasionally gets audited by the FDA as we're a medical imaging company. We need pass/fail for specific steps and not just entire test runs because the pass/fail has to trace back to a specific requirement so we can show tracability.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: How to implement QC/ALM connection

Post by Support Team » Wed Mar 05, 2014 4:13 pm

Hello livelyjay,

Unfortunately this is not possible out of the box because QC only gets the state of the whole test suite.
As workaround you could run every test case separately using, for example the command line parameters as described in our user guide in the section "Running Tests via Command Line". Every Test Case should return a separate value.

Regards,
Bernhard

livelyjay
Posts: 5
Joined: Tue Feb 25, 2014 7:22 pm

Re: How to implement QC/ALM connection

Post by livelyjay » Wed Mar 05, 2014 4:54 pm

I'm well aware that it's not possible out of the box. I'd have to write code to access the QC API adapter to update the test step status. Here's the code I wrote inside QTP to tie the script to a test run and update each test step. This all worked seamlessly. The missing link for Ranorex would be initiating the test run, as QTP accomplishes this through a "Run Dialog", and if you launch the test from QC it would create the new run automatically.

Function QCBeginReport
If QCUtil.IsConnected Then
Dim currentRun, allSteps, i
Set currentRun = QCUtil.CurrentRun
currentRun.CopyDesignSteps
Set allSteps = currentRun.StepFactory.NewList("")
QCUtil.CurrentRun.Field("RN_DRAFT") = "N"
End If
End Function

Function QCReportEvent(Status, StepName, Actual)
If QCUtil.IsConnected Then
Dim currentRun, allSteps, i
Set currentRun = QCUtil.CurrentRun
Set allSteps = currentRun.StepFactory.NewList("")

For i = 1 to allSteps.Count
If (allSteps.item(i).name = StepName) then
allSteps.item(i).Field("ST_ACTUAL") = Actual
allSteps.item(i).Status = Status
allSteps.item(i).Post
Exit For
End If
Next
End If
End Function

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: How to implement QC/ALM connection

Post by Support Team » Thu Mar 13, 2014 4:31 pm

Hi livelyjay,

Thank you for sharing your code. Unfortunately I have no experience with the QC API adapter, so I am afraid that I cannot help solving your issue.
Maybe some other users in this forum are familiar with the QC API adapter and can help.

Regards,
Bernhard

livelyjay
Posts: 5
Joined: Tue Feb 25, 2014 7:22 pm

Re: How to implement QC/ALM connection

Post by livelyjay » Fri Mar 21, 2014 1:31 pm

After doing some research on the QC API and updating the VBS code posted by sdaly in another thread, I was able to figure out how to update first the overall test run status. After I accomplished that it was pretty simple to follow what I did in QTP and implement the code needed in Ranorex to update the individual test steps in QC.

The problem I have is inside my test script I hard coded the Test Plan and Test Set for the Quality Center update to work. Is there a way I can launch the test from Quality Center, and send the Test Plan and Test Set paths to Ranorex using arguments (parameters)? I attached a screenshot that shows how I attempted to do this, but it doesn't work and I'm still trying to get familiar with launching Ranorex through QC (it works as shown in the screenshot, but the reports aren't attaching and it's running the entire test suite instead of just the test case I put in the parameters).
You do not have the required permissions to view the files attached to this post.

mzperix
Posts: 137
Joined: Fri Apr 06, 2012 12:19 pm

Re: How to implement QC/ALM connection

Post by mzperix » Tue Apr 01, 2014 9:47 am

Look for running Ranorex test from command line: http://www.ranorex.com/support/user-gui ... html#c4827

There is an option to tun a certain testcase, and also to pass parameters to them. And as I saw, you can set where the report file should be saved.

Hope this helps.
Zoltán