• Home
  • Company
    • About
    • Customers
    • Testimonials
    • Contact Us
    • My Account
  • Products
  • Downloads
  • Tutorials
  • Professional Services
  • Home
  • Company
    • About
    • Customers
    • Testimonials
    • Contact Us
    • My Account
  • Products
  • Downloads
  • Tutorials
  • Professional Services
Free Edition Compatible
How to Run Coronys Tests from HP Quality Center
Objectives
In this tutorial you'll learn HOW TO:
► Run Coronys tests from HP QC Test Lab
► Customize the QC side settings
► Connect Coronys to the QC project 
► Enable the test launch and reporting results to the Test Lab
► Use ETS Post-Test hook mechanism
All Tutorials
How to ...
QC Side
Step 1. Install Connectivity Add-In
To execute Coronys tests from HP Quality Center you must install the Connectivity Add-in on the clients. Connectivity Add-In enables Coronys to update the QC with the test results.
Accomplish the following steps on each client machine that accesses the HP ALM server before you execute Coronys integration tests from within Quality Center.
1. Log in to HP Quality Center using an account with administrator privileges. If you are using HP Quality Center 11.5, in a browser window, open the page http://host:port/qcbin/ to log in.
2. On the menu bar, click Help > Add-Ins Page. If you are using HP Quality Center 11.5, click Tools
3. Click HP Quality Center Connectivity on the Add-Ins window. The HP Quality Center Connectivity Add-in page is displayed.
4. Click Download Add-in.
Follow the instructions that are provided to install the Connectivity Add-In.
After you installed the Connectivity Add-In, restart the Quality Center client to enable the changes to take effect.
Step 2. QC Customization
1. Open QC ALM Project Customization module by navigating to "tools" ⇒ "Customize"
2  Go to "Project Entities".
3  Add a new field under "User Fields" of the "Test Step" entity.
4  Provide the following settings:  Label =  "CORONYS_Par."   ;  Type = "String"  ;  "Length = "255".
5. Click "Save" and then "Return".
Step 3. Create a New VAPI-XP-TEST
Create a new test node in the main tree from the "Test Plan" tab.
1. Set the test type to “VAPI-XP-TEST".
2. Select VBScript as Script language.
3. Set “COM/DCOM Server Test"  as test type.
4. Finish the HP VAPI-XP Wizard.
Step 4. Add Parameters for Coronys Automation
Go to test "Design Steps" window and add 3 following parameters:
1. Target Coronys Station IP
Add "New Step": 
In column "Step Name" enter " Coronys_ets_ip".
In column "CORONYS_Par." enter  the IP and port of the PC that will run the test.                 
For example:  1.1.1.1@30000    
2. Coronys Test Case Name 
Add "New Step": 
In column "Step Name" enter " Coronys_TestCase".
In column "CORONYS_Par." enter  the path of the Coronys test to be run (ESL file).
For example:  C:\ETS_Workspaces\MyProject\TestCases\MyTestCase.ESL     
3.Coronys Log File Location: 
Add "New Step": 
In column "Step Name" enter " Coronys_LogFile".
In column "CORONYS_Par." enter  the desired path of the Coronys log file.
For example:  C:\C:\ETS_Workspaces\LogFiles\Default.log
4. Copy the following designated VBScript function "Test_Main()" using the test "Test Script" window.
Sub Test_Main(Debug, CurrentTestSet, CurrentTSTest, CurrentRun)

  On Error Resume Next

  TDOutput.Clear
  crun= CurrentRun.id
  ctest=currentTsTest.id
  test =CurrentTest.id
  msgbox test
  Set Steps = CurrentRun.StepFactory.NewList("")

  TDOutput.Clear

  tiac = Steps.Item(1).Field("ST_USER_01")
  TestScriptName = steps.Item(2).Field("ST_USER_01")
  LogFileName = steps.Item(3).Field("ST_USER_01")
  job =   "c:\ets\cmdtojob.exe -JSFN " & TestScriptName &" -TIAC " & tiac &" -P ""crun=`" & crun & "`, ctest=`" & ctest & "`"""

  XTools.run job

' msgbox CurrentRun.id
' msgbox currentTsTest.id

  If Not Debug Then                                     '
  End If
  ' handle run-time errors

End Sub
5. Adjust the VB script if needed and Save it.
Step 5. Run Test from Test Lab
1. In "Test Lab" tab:  Drag the test created to an existing Test Set.
2. Go to "Execution Grid", mark the test and choose "Run" to run the specific test or "Run Test Set" to run all tests in test set.
3. When the "Automatic Runner" window opens, make sure the 2 checkboxes are marked:
• "Run All Tests Loacally"
• "Enable Log".
4. Click "Run".
5. As the status changes to "Passed", close the "Automatic Runner" window to see the updated "Status".
6. Double click on the test and choosing "Runs" will show the history of the test's runs. 
Coronys Side
Add "Bottom Most" Hook
We'll report the test results to the QC, using the ETS post-test hook mechanism.
The post-test hook called "Bottom Most" is automatically invocated by ETS when a test has completed and all statistics are available.
Learn how to add and implement the "Bottom Most" hook.

1. In Coronys ETS, open ESL editor:  "Tools" ⇒ "ESL Editor".
2. Go to:  "File" ⇒ "Open Special" ⇒ "WS Bottom Most".
Write "Bottom Most" script
1. Copy the ESL code (written partly in VBScript language) into the newly created script "WS_BottomMost.ESL".
2. Update http://server:8080/qcbin to your server real address, user name and password.
3. Save the ESL script.
     Declare  Status ,  VBhnd
     DeclareOnce  crun = 0 ,  ctest = 0 ,  pfState  =   "Passed"
     if   GT_TotalFailCnt   >   0   Then  pfState  =   "Failed"
     if   ( crun  >   0 )   &&   ( ctest  >   0 )   Then
         ES_Create  VBhnd ,   0
         ES_SetLanguage  VBhnd ,   `VBScript`
                
         ES_AddCode VBhnd, 0
             Function Answer (testsycl_id, rn_id, State)                                            
             Dim tdconnection
             Set tdconnection = CreateObject("Tdapiole80.tdconnection")
             tdconnection.InitConnectionEx "http://server:8080/qcbin/"
             tdconnection.Login "****","****"
             'msgbox  tdconnection.LoggedIn
             tdconnection.Connect "Quality_Center","Quality_Center"
             Set com = tdconnection.Command
             sqlstr = "Update run set RN_STATUS='" & State &"'" & " where rn_run_id = " & rn_id 
             'msgbox sqlstr
             com.CommandText=sqlstr  
             com.execute 
             sqlstr = "Update testcycl set TC_STATUS='" & State &"'" & " where tc_testcycl_id = " & testsycl_id
             com.CommandText=sqlstr  
             com.execute                           
             Set com = nothing 
             If  tdconnection.Connected  Then
                 tdconnection.Disconnect
             End If
             Set tdconnection= nothing 
             End Function            
         ES_EndCode
        
         ES_RunProcedure  Status ,  VBhnd ,   "Answer" ,  ctest ,  crun ,  pfState
         ES_Delete  VBhnd
     EndIf
            
;   Let _RetStat = 0
;   Let _RetVal  = 0
     End   ;@DBG:NEST - 1 - @DBG:IsInJob; Exit Current Test
Download Your Free Edition
Hands-on ...
To do your hands-on practice more effective:
Watch the "How to Automate Windows Command Line Operations" tutorial.
Watch the "How to Write Data Driven Test" tutorial.
See Spirent Service Center article "How do I load a Spirent TestCenter GUI configuration using TCL API?".
Install the ETS Free Edition on your PC.
Download the "Get Started" project with all up-to-date tutorial scripts. Unzip it to C:\ETS_Workspaces.
  • Home
  • Products
  • Downloads
  • Tutorials
  • Contact Us
  • Terms of Use
  • Privacy Policy

Copyright © 2002-2017 Coronys Ltd. All Rights Reserved.
 
Back to top