Results 1 to 4 of 4
  1. #1

    how to retrive all the detail from result.xml file

    Hi All,

    I'm trying to retrieve all the steps detail(for e.g. user id ,pwd, clicking on link, button etc) from the result.xml file?

    Can someone help here.


  2. #2
    SQA Knight bklabel1's Avatar
    Join Date
    Sep 2012
    Kew Gardens, United States
    Hi Peenky,
    It looks as if you are trying to pull data from the results log after the script runs. Then report what the script did. The propblem is that the result file is not created until after the script stops running so this wont work unless you start another QTP script which analysis the first one.



  3. #3

    thank you for your reply here!

    See here, what i would like to do...

    I have requirement that i need to add/update each and every Test Cases in a QTP action( for example: enter Uid , pwd, clicking on a link etc) in sql DB.

    Is there any other way i can do this?

  4. #4
    Advanced Member
    Join Date
    Mar 2007
    Salt Lake City, UT, USA
    Interesting requirement.

    I would write a function in my QTP Function Library that makes this SQL call. Pass in whatever parameters you need to construct your SQL statement to update the DB with the test case and the values you need to set (pass/fail, etc.). Then call this function after each step in your QTP script where a test case is validated. This means stop using checkpoints (if you are using them) and start writing your own. It would look a little like this:

    myVal = Browser(X).Page(Y).Object(Z).GetROProperty("innert ext") 'or whatever property you care about
    If myVal = SomeExpectedValue Then
    Reporter.reportevent micPass, "Test summary", "Test description"
    Call DbReportFunction 'with pass values
    Reporter.reportevent micFail, "Test summary", "Test description"
    Call DbReportFunction ' with fail valjues
    End If

    Now you use a homemade checkpoint like that for everything in your script that you need to test.

    And if you feel a little ambitious, you can write your own homemade function to replace the Reporter.ReportEvent functionality so that it can do everything for you - report the test results AND call your SQL statement, all in one function.

    And then for extra credit, write a whole new function that actually does the test for you. You send it an object description and a property, and it does everything I coded above. It gets the property, tests against expected results (you pass the expected result as a function parameter), reports the pass/fail, and makes the DB SQL call - all in one handy function so that you only need to insert one line of code into your script each time you want to test something.
    "The last 10% of any software project will take 90% of the budgeted time. The first 90% will take the other 90%"



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 05:50 PM.

Copyright BetaSoft Inc.