Friday, 27 December 2013

ALM ServiceWrapper Part 3


Current and Stable : ALM Service Wrapper ( v2.0 )
***************************************************************

with this new version of the project, the following things can be done through code :)

* For a Test Set you can do the Following
  •    Create Attachment

* Ability to Create a Run for a given Test Case and Set the Following fields
  •    Set Run Name
  •    Set Run Status
  •    Create Attachment
* Ability to Create Test Execution Steps and Set the Following fields for a Test Case Run
  •    Step Name
  •    Step Result
  •    Step Description
  •    Expected Result
  •    Actual Result
  •    Create Attachment
* Ability to Create Defects/Bugs and Set the Following fields


  •    DetectedBy
  •    AssignedTo
  •    Defect Priority
  •    Defect Severity
  •    Defect Status
  •    Defect Detection Date
  •    Summary
  •    Description
  •    isReproducible
  •    Project
  •    Create Attachment

61 comments:

  1. What about automating the site admin activities?

    ReplyDelete
    Replies
    1. Admin Activities? Can you explain where we can use this. If your requirement is necessary, we can add the features.

      Regards
      AT

      Delete
    2. Admin activities are less frequent.

      When some task repeats frequently its advisable to automate the process.

      I think it will take same amount of time if admin activities are automated vs manual.

      Please let me know if I am wrong.

      Delete
  2. Hi, you have very interesting projects, keep up the good work!,

    do you know when you will realease the part 3 of ALM Service wrapper?

    ReplyDelete
    Replies
    1. Well, The current API has required methods to connect to ALM, the next version would have support for RestAPI along with any user requested features.

      Regards
      AT

      Delete
  3. Hi AT,

    Thanks for the fantastic API.

    Quick question though - I'm trying to upload a zip archive containing screenshots from my automation test execution to QC 11.

    I can manually upload these zip files from the web interface, but when uploading programatically I get the 0KB modified in 1970 issue (loosely described here -http://h30499.www3.hp.com/t5/Quality-Center-Support-and-News/Attachments-in-QC-10-get-uploaded-as-0kb-files/td-p/2391715#.UzFJy6iSyuI)

    I've checked that the zip functionality releases the archive before uploading, so its not open during the upload. I've also tried using the AttachmentFactory to addItem to the attachment collection of the testcase but instantiating it with null throws an error which prevents me then from being able to edit the fileType as mentioned here (http://www.codetweet.com/other/solved-attachments-uploading-0kb-size-almqc-using-ota/)

    Id be ever so grateful for any insight you might be able to provide.

    Thanks in advance

    ReplyDelete
    Replies
    1. Hi,
      Let me run a test to see the issue. I will update accordingly

      #AT

      Delete
    2. Any feedback with regards to this issue?

      Delete
    3. The issue is logged. Thank you for your feedback. As soon as the issue is fixed, you can expect a new release.

      #AT

      Delete
    4. Awesome! Thanks man. Looking forward to it.

      Delete
    5. Hi AT, has this been fixed yet?

      Delete
    6. Hello,

      Please log your issue in the below page.

      https://docs.google.com/spreadsheet/ccc?key=0ArrZvkq9tkwPdEpfa0tFN0RIQ0ZyXy1mSGZPdzl4MVE&usp=drive_web#gid=4

      #AT

      Delete
    7. Hi AT,

      We also having this issue.
      Whats status?

      Delete
    8. Hello All,

      Does anyone has any update on this issue please ? I am still facing the same challenge of not able to upload properly (I get the 0KB modified in 1970 issue ) always.

      Delete
    9. Any update on this AT team? Many of us are facing the same issue.

      Delete
  4. Hi AT,
    I am into adding test run and adding test step now. I was able to add the Test run. This is what I used. No issues here. this correctly updated QC.
    wrapper.createNewRun(wrapper.updateResult(TestSetFolder, TestSet, Integer.parseInt(CycleID), TestCaseName,nResult),"Run "+GetCurrentDateTime(),nResult);

    But when i tried adding the addstep as
    wrapper.addStep(wrapper.createNewRun(wrapper.updateResult(TestSetFolder, TestSet, Integer.parseInt(CycleID), TestCaseName,nResult),TestCaseName,nResult),"abc", nResult, "aa", "aa", "aa");

    i got a permission error saying the below. I feel that there are some specific permission that is denied for the user that i am using. If you could tell the exact QC permission that is required for this I will be able to get that access given from my QC admin:
    com.jacob.com.ComFailException: Invoke of: Field
    Source:
    Description: You do not have the required permissions to execute this action.

    at com.jacob.com.Dispatch.invokev(Native Method)
    at com.jacob.com.Dispatch.invokev(Dispatch.java:625)
    at com.jacob.com.Dispatch.invoke(Dispatch.java:498)
    at atu.alm.wrapper.classes.Step.setStatus(Step.java:25)
    at atu.alm.wrapper.ALMServiceWrapper.addStep(ALMServiceWrapper.java:199)
    at MI.UpdateQC.ReportResultToQC(UpdateQC.java:89)
    at MI.RunTestCases.RunCases(RunTestCases.java:639)
    at MI.RunTestCases.main(RunTestCases.java:151)

    ReplyDelete
    Replies
    1. Hi AT,
      Good News.. I figured it out myself. after getting the QC admin permission I had to update the transition rules for Status[STEP]. We had few customized items set there..

      Permission setting is under Test Lab > Modify Run > Status [STEP].
      And it worked!!!

      And finally one full round of test case run which updated the test step, test run and the execution grid successfully!!.

      So you can consider my earlier issues as resolved.
      Your utility is indeed great. Thanks again.

      Delete
    2. This is great stuff.
      Delighted :)

      #AT

      Delete
    3. Hi,
      When I am creating a new Run and adding the Steps for this Run, then first I need to pass the ITestCase as one of the parameters (which I will get by updating Test Case Result). Now as a result of this, what is happening is that for the same Test Case,2 set of runs are getting created. So, is there any way to get rid of this ?

      Delete
  5. Hi AT,

    I have tried to create a new defect by passing the parameter, but getting the Jacob.com. exception Invoke of Add Item error.
    can you please help me to resolve the issue.
    i have added jacob dll i am able to update the test run.
    Please help me to create a new defect.

    ReplyDelete
    Replies
    1. Hi,

      An example project is provided, you can find sample code for creating a defect. Try it and let me know.

      #AT

      Delete
  6. Hi AT,
    Is it possible addstep for a single run?
    Is it possible to use the update Result with exsiting run?

    if i using this, it is creating 2 run in QC.. any solution for this?

    ReplyDelete
    Replies
    1. wrapper.addStep(wrapper.createNewRun(wrapper.updateResult(TestSetFolder, TestSet, Integer.parseInt(CycleID), TestCaseName,nResult),TestCaseName,nResult),"abc", nResult, "aa", "aa", "aa");

      Delete
    2. Create a run object , then use this object to add individual steps. This will reflect only to the current Run.

      #AT

      Delete
    3. coul dyou please help me to split

      Delete
    4. In the example project, you can find the steps to do it.

      #AT

      Delete
  7. when i try to run this code i am seeing error message that "itest" is not defined

    ReplyDelete
  8. Is it possible to add test case without providing Cycle Id ?

    ReplyDelete
  9. Hi AT,

    When I am uploading a word/pdf document to QC with the following code, I am seeing the attachment uploaded as 0 KB. I saw the same issue being reported earlier in the blog. Is this resolved?

    wrapper.newAttachment("C:\\test\\Test_Run 2-9-2014 6 59.pdf", "My Attachment Description",testSet);

    ReplyDelete
    Replies
    1. Hi AT,

      I am also facing the same issue . Please let me know how to resolve it.

      Delete
  10. Why I am keeping getting
    Please Register the OTAClient.dll with your system
    Even after doing the successful registration ?

    ReplyDelete
    Replies
    1. Hi Nikesh,

      Could you please tell if you are able to find solution to your issue?

      Regards,
      Jagdeep

      Delete
    2. Hi friends, I am also having similar issue "Please Register the OTAClient.dll with your system" the only difference I can see is I am using 64bit JDK will that make any difference?

      Delete
  11. Hi,

    How do we implement updating test case results in Test Lab (Built using ALM BPT)

    Thanks,
    Ramesh

    ReplyDelete
  12. Hi There,

    If I need to test the application in Firefox browser and ALM can only be accessed in IE. How can we handle such scenarios for launching two different kind of browsers?

    ReplyDelete
  13. Exception in thread "main" ALM Service Wrapper Exception Details: Unable to Establish connection for the Given URL: http://usilap572.ca.com:8080/qcbin
    at atu.alm.wrapper.classes.TDConnection.initConnectionEx(TDConnection.java:48)
    at atu.alm.wrapper.ALMServiceWrapper.connectToOTA(ALMServiceWrapper.java:101)
    at atu.alm.wrapper.ALMServiceWrapper.connect(ALMServiceWrapper.java:74)
    at SeleniumALMIntegrationExample.main(SeleniumALMIntegrationExample.java:21)

    ReplyDelete
  14. I want to create a new test set and update results for all the test steps. Do u have any tutorial document?? For the same

    ReplyDelete
  15. Getting issue executing. Error as follows,

    com.jacob.com.ComFailException: Invoke of: Status
    Source:
    Description: You do not have the required permissions to execute this action.

    at com.jacob.com.Dispatch.invokev(Native Method)
    at com.jacob.com.Dispatch.invokev(Dispatch.java:625)
    at com.jacob.com.Dispatch.invoke(Dispatch.java:498)
    at atu.alm.wrapper.classes.Step.setStatus(Step.java:25)
    at atu.alm.wrapper.ALMServiceWrapper.addStep(ALMServiceWrapper.java:199)
    at MI.UpdateQC.ReportResultToQC(UpdateQC.java:89)
    at MI.RunTestCases.RunCases(RunTestCases.java:639)
    at MI.RunTestCases.main(RunTestCases.java:151)

    ReplyDelete
    Replies
    1. Hi Sunil,

      Were you able to resolve this issue ? Is yes can you please share more details on how you did it ?

      Thanks

      Delete
  16. Thanks for sharing great information in your blog. Got to learn new things from your Blog . It was very nice blog to learn about Selenium.
    Selenium

    ReplyDelete
  17. Hi AT, Great tool and thank you a lot. Could you please confirm this tool has a capability to update result as "FAILED" for current RUNID if one step is failed?

    My scenario is - CreateNewRun with - No Run Status then start executing my script and addsteps as pass or fail if one step is failed then overall result should be fail

    With this tool I am not able to do it - am lacking of knowledge to use this tool or this tool will not support above kind of scenario

    this below code - is creating a new testrun and marked it as passed - this is my starting point
    wrapper.createNewRun(wrapper.updateResult(TestSetFolder, TestSet, TestSetID, TestCaseName,STATUS.PASSED),TestCaseName,STATUS.PASSED)

    if (somecondition) {
    addstep( addStep(stepname,expectedResult,ActualResult,"passed");)
    } else
    {
    addstep( addStep(stepname,expectedResult,ActualResult,"failed");)
    }

    the above code sets my RUNID overall result as "PASSED" evenhtough one step is failed

    I am keep trying past 2 days with different techniques but nothing works please kindly direct me

    Let me know if this is not clear

    Kind Regards

    ReplyDelete
  18. This comment has been removed by the author.

    ReplyDelete
  19. Hi AT, please reply to my comments

    ReplyDelete
  20. please can someone direct, how do I update results for particular RUNID

    ReplyDelete
  21. Having Exception Access Violation issue while running my test using Maven Surefire Plugin. Tried with JDK 32 bit 1.6. 1.7 or 1.8. Having same issue. Please help.

    ReplyDelete
  22. Can anyone share the ALM Service Wrapper ( v2.0 ) jar or the path where it is available

    ReplyDelete
  23. I want to update the actual result for every step.
    Any one can post the sample code for that

    ReplyDelete
  24. Well explained. Got to learn new things from your Blog on Appium.Appium training in chennai

    ReplyDelete
  25. Hello All,
    I want one help.
    Using ALM Service Wrapper ( v2.0 ), I have been trying to programmatically upload the attachment for each Test Case.
    For that we have already written the code using the ALM Service Wrapper(v2.0). But,when we execute the code, the file is getting attached to that particular Test Case, but it is devoid of any contents and also the file size is showing as 0 KB. Also in the modified column we are getting the timestamp as of 1970.

    Does anybody help please in how to resolve this?

    Just fyip,when I am manually uploading the attachments, it is behaving perfectly fine with proper file size and contents.

    ReplyDelete
  26. Hello AT ! Nice Job. This Works perfectly to me on the first go itself without any issue. One Improvement Suggestion - See usually people create Regression Test Suite Folder in Test Plan and they Create Folders and Drag Tests and Make Folder in Test Lab. Can we make this happen automatically ? Example - If my Regression Test Plan Suite has 100 Tests, If i run Regression Automation Suite, first it should Create Folder with date n time stamp Under test lab with all 100 Tests and then update test results ?

    ReplyDelete
    Replies
    1. Hello Indira,
      One query. Did you managed to upload the attachment for each Test Case please? If yes, can you tell how you did that?

      Delete
  27. Anybody resolved the 0KB file upload issues?

    ReplyDelete
  28. Hi team I need to update all my test step to pass let me know how I can do that with alm wrapper...my scripts are passing as whole results as pass.....

    ReplyDelete
  29. Hi team I need to update all my test step to pass let me know how I can do that with alm wrapper...my scripts are passing as whole results as pass.....

    ReplyDelete
  30. This comment has been removed by the author.

    ReplyDelete
  31. Hi,

    I followed all the steps, on run i'm getting this error "Please add the jacob-(version-bit-type).dll file to the System path" but added the path to the "path" environment variable. it will be great if you help me on this.

    ReplyDelete
  32. This is working fine except 0 KB attachment issue. Developer please make a solution of this. It will be useful for so many users.

    ReplyDelete
  33. Is there a way to update the test results by passing the Test Id instead of the Test Case Name. Referring the 4th parameter of the below method.
    wrapper.updateResult(pathToTestSetFolder, testSetName, testSetID, testCaseName, result);

    ReplyDelete