Thursday 21 August 2014

Zephyr Test Management Tool Integration with Telerik Test Studio

Overview:
This article provide the approach to integrate Telerik Test Studio scripts with Zephyr and will perform following activities:
  • Test case script kick-off from Zephyr
  • Test case script result updation in Zephyr

Pre-Requisite:
Below are the pre-requisite:
  • Automated Test case is created in Zephyr. (Note: Test case type will show “A”)
  • Automated Test case is appearing in Zephyr execution panel. (Note: “E” button will appear against the test case to start the execution of script)
  • Zephyr Zbot should be installed, configured and started properly in any machine. (Note: Please contact Zephyr support team for ZBot setup)

Creation of Java Wrapper:
We have to create a Java wrapper code which will have following features:
  • Read the Telerik result file.
  • Fetch the test case result (either Pass or Fail).
  • Update the status in Zephyr by get the results for “currentTestcaseExecution” and call “scriptUtil.updateTestcaseExecutionResult()” in “public void testcaseExecutionResult()” method.
  • Export the java project in *.jar file.

Deployment of Java Wrapper:
Below are the steps to deploy the Java wrapper:
  1. In $ZBOT_HOME\conf\wrapper.conf, add following entries
  2. wrapper.java.mainclass=com.thed.wrapper.ZephyrWrapperSimpleApp
    wrapper.java.classpath.5=../plugin/ZephyrWrapperCode.jar
    wrapper.java.classpath.6=../lib/ZephyrWrapperCode.jar
  3. Copy jar file to $ZBOT_HOME\lib\
  4. Copy jar file to $ZBOT_HOME\plugin\
  5. Make sure scriptLauncher property is set in $ZBOT_HOME\conf\zbot.properties
  6. scriptLauncher=com.testzip.zip.ZephyrWrapperCode
  7. Restart ZBot

Approach:
  • In Zephyr automation test case “Path” field, we have to provide the parameterize batch file path with parameter value as Telerik web test name so that specific test case script should execute.
  • Eg: In “Path” give value as “C:\TelerikExecution\ZephyrTelerik.bat DummyWebTest”
  • Batch file will have Telerik Project web test execution through command prompt.
  • Click on “E” in Zephyr, select the ZBot and Click on “Run”.
  • Telerik script will be executed through batch file, once execution will over Zephyr wrapper will read the test case test cases result and will update the status in Zephyr.
  • Flow diagram

6 comments:

  1. Can you give more explanation on the .bat file creation parameters?

    ReplyDelete
    Replies
    1. Hi Ryan,

      In batch file, we are executing the Telerik script through command line and as "%1" we will pass the respective Zephyr test case Telerik web test name.

      In brief, 'ArtOfTest.Runner.exe' is used to run the Telerik project from command line and 'root' or 'test' are options of 'ArtOfTest.Runner'.

      For more Information refer: http://docs.telerik.com/teststudio/user-guide/test-runners/artoftestrunner.aspx

      Regards,
      Bhaskar Joshi

      Delete
    2. I am able to create the bat file and execute it by double clicking on it.
      However, zbot will not run the bat file. It never kicks off and runs on the host machine. thoughts??

      Delete
    3. also, do you have example of the Creation of Java Wrapper:
      We have to create a Java wrapper code which will have following features:
      •Read the Telerik result file.
      •Fetch the test case result (either Pass or Fail).
      •Update the status in Zephyr by get the results for “currentTestcaseExecution” and call “scriptUtil.updateTestcaseExecutionResult()” in “public void testcaseExecutionResult()” method.
      •Export the java project in *.jar file.

      Delete
    4. To execute a batch file from Zephyr, for a test case tick the Automated check box and pass the batch file path of ZBOT machine in "Path" field. It will enable "E" button for that test case in Test Execution.

      In Telerik result file, "Overall Result: Fail" means test case failed and "Overall Result: Pass" means test case passed.
      You can use "java.util.Scanner" to read the content of Telerik result file and fetch the test case Pass/Fail status from it.

      Please let me know if any concern.

      Delete
    5. I can execute now with no issues. I need help now creating this Java wrapper code to pull the results in to Zephyr. Thanks.

      Delete