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

68 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
    3. Yes. The current implementation works well with 32bit JDK only.

      Delete
    4. Hi,

      I am using the 32 bit JDK even though i am getting the same error saying "PLEASE REGISTER THE OTAClient.dll WITH YOUR SYSTEM". IF any one facing the same issue and found the solution could you please help me out to solve.

      Thanks & Regards,
      Dinesh kumar.

      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. 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
  17. This comment has been removed by the author.

    ReplyDelete
  18. Hi AT, please reply to my comments

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

    ReplyDelete
  20. 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
  21. Can anyone share the ALM Service Wrapper ( v2.0 ) jar or the path where it is available

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

    ReplyDelete
  23. 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
  24. 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
  25. Anybody resolved the 0KB file upload issues?

    ReplyDelete
  26. 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
  27. 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
  28. This comment has been removed by the author.

    ReplyDelete
  29. 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
  30. 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
  31. 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
  32. Thanks you TA, I am able to now update results, raised defects etc. using selenium automation script into HP ALM.

    But how to make HP ALM should trigger the Selenium script ?
    I mean, from HP ALM I should able to start execution of selenium automated script.

    ReplyDelete
  33. Hi,
    When I try to create a defect with " IDefect defect = wrapper.newDefect();", the following exception is raised :

    com.jacob.com.ComFailException: Invoke of: AddItem
    Source:
    Description: Parameter Type is Invalid

    at com.jacob.com.Dispatch.invokev(Native Method)
    at com.jacob.com.Dispatch.invokev(Dispatch.java:625)
    at com.jacob.com.Dispatch.callN(Dispatch.java:453)
    at com.jacob.com.Dispatch.call(Dispatch.java:541)
    at atu.alm.wrapper.classes.Bug.init(Bug.java:29)
    at atu.alm.wrapper.classes.Bug.(Bug.java:21)
    at atu.alm.wrapper.classes.BugFactory.addItem(BugFactory.java:26)
    at atu.alm.wrapper.ALMServiceWrapper.newDefect(ALMServiceWrapper.java:240)


    Does anyone have an idea on how to solve that problem ?

    Thanks

    ReplyDelete
  34. Requirement is to fetch the test case data from hp alm i.e no of pass test cases and no of failed test cases.Can you please tell me how to solve such a problem.

    ReplyDelete
  35. Even i am getting the above error -
    Exception in thread "main" com.jacob.com.ComFailException: Invoke of: AddItem
    Source:
    Description: Parameter Type is Invalid

    on line - IDefect defect = wrapper.newDefect();

    Did anyone find a solution to this?

    ReplyDelete
  36. Will this work with SSO (single signon) of ALM 14 which is now SAAS. IF so how we need to do authentication

    ReplyDelete
  37. Files are getting attached at the Test Case level.Is it possible to attach file against every steps of a particular Test case??

    ReplyDelete
  38. Hi, how to retrieve test case name and Test Set ID to pass/fail specific group of test cases from ALM.

    Thank You,
    Kevin

    ReplyDelete
  39. Hi,

    I am able connect alm but attachments are showing 0 please help

    ReplyDelete
  40. I am able connect alm but attachments are showing 0kb in alm

    please help

    ReplyDelete