SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    New Member
    Join Date
    May 2016
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    [UFT] [API] Get status of a Iteration/test on runtime

    Hi all,

    I need to get the actual test/iteration result on runtime.

    It is possible to do that with UFT API using custom code or something else?

    On the manual of UFT I read that we can get some properties of the test iteration using the UI Element "TestIteration" (Custom Code).

    But it's no said how we can do that....


    Thanks all

  2. #2
    Moderator
    Join Date
    Sep 2001
    Location
    Doncaster, UK
    Posts
    5,819
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    TestIteration is an in-built environment variable which holds the current iteration number.

    Go to File > Settings > Environment to see all the available in-built env vars.

    There is no env var for iteration result.

    We don't use UFT reporting, we have created our own and at the start of each iteration we set a global var IterationStatus = "False" if we get an error True. At the end of the iteration I know the status of it.

    Mark Smith.

  3. #3
    New Member
    Join Date
    May 2016
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    Quote Originally Posted by mwsrosso View Post
    TestIteration is an in-built environment variable which holds the current iteration number.

    Go to File > Settings > Environment to see all the available in-built env vars.

    There is no env var for iteration result.

    We don't use UFT reporting, we have created our own and at the start of each iteration we set a global var IterationStatus = "False" if we get an error True. At the end of the iteration I know the status of it.

    Mark Smith.

    Thank you Mark for your fast answer.

    I'm testing Webservices with UFT-Service test (API) and I want just like you have a paralel report on runtime.

    The issue is that I'm not able to know if an action or activities failed or passed. I have checkpoints but i don't know how to get the pass or fail status of that checkpoints.

    I'm a rookie with UFT but I worked with severeals other automation tools and all of them has a internal variable that indicate the state of the test on run (pass/fail).

    Can you please tell me how do you catch the pass or fail of your checkpoints? My checkpoints are on blocks of the activities.


    Thanks again.

  4. #4
    Advanced Member
    Join Date
    May 2007
    Posts
    612
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0
    You can assign a variable to get the result of a checkpoint like this:
    Code:
    blnResult = Browser("MyBrowser").Page("MyPage").Check ( CheckPoint("MyProperty"))
    Dennis Belew

  5. #5
    New Member
    Join Date
    May 2016
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    Quote Originally Posted by belewda View Post
    You can assign a variable to get the result of a checkpoint like this:
    Code:
    blnResult = Browser("MyBrowser").Page("MyPage").Check ( CheckPoint("MyProperty"))
    Thank you for your anwer,

    I need something like this but for UFT API (system test).

  6. #6
    Advanced Member
    Join Date
    May 2007
    Posts
    612
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0
    Sorry, I didn't read the question closely enough. I've never actually used the UFT API testing functionality. I always built my own functions to send/receive the HTTP info (mainly because the API functionality wasn't available when I needed it). If I get some free time this afternoon, I'll try to test a few things and see if I can come up with a more useful answer.
    Dennis Belew

  7. #7
    Moderator
    Join Date
    Sep 2001
    Location
    Doncaster, UK
    Posts
    5,819
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    When I did webservice testing I would have the XML response written to a variable, I would then use 2 split commands to extract any error messages, something like

    Code:
    myXML = "<tag1>TEXT</tag1><errorMessage>It Failed</errorMessage><tag2>More Text</tag2>"
    tmp = Split(myXML,"<errorMessage>")
    tmp1 = Split(tmp(1),"</errorMessage")
    MsgBox tmp1(0)
    Mark Smith

  8. #8
    Moderator
    Join Date
    Oct 2010
    Location
    Norway
    Posts
    3,268
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0
    Quote Originally Posted by Carlos Dias View Post
    Thank you for your anwer,

    I need something like this but for UFT API (system test).
    Here you go. It isn't straightforward though :-)

    Code:
    List<IterationStatus> iterationList = this.Context.ExecutionStatus.IterationStatus;
    
    if (iterationList.Count > 0)
    {
      this.Context.UserLogger.Info(iterationList[1].CheckpointFailed.ToString());
      this.Context.UserLogger.Info(iterationList[1].Succeed.ToString());
    }
    Note that the IterationStatus object will be available only after the Iteration is completed i.e you can get the Iteration 1 data, only during Iteration 2.

    You could add 2 Report Activity, one as the First activity in the Loop & the other outside the Loop. This way you get both the First & the Last iteration data.
    Rajkumar

  9. #9
    New Member
    Join Date
    May 2016
    Posts
    9
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0
    Quote Originally Posted by Rajkumar Rajangam View Post
    Here you go. It isn't straightforward though :-)

    Code:
    List<IterationStatus> iterationList = this.Context.ExecutionStatus.IterationStatus;
    
    if (iterationList.Count > 0)
    {
      this.Context.UserLogger.Info(iterationList[1].CheckpointFailed.ToString());
      this.Context.UserLogger.Info(iterationList[1].Succeed.ToString());
    }
    Note that the IterationStatus object will be available only after the Iteration is completed i.e you can get the Iteration 1 data, only during Iteration 2.

    You could add 2 Report Activity, one as the First activity in the Loop & the other outside the Loop. This way you get both the First & the Last iteration data.
    This is exactly what I need. Thank you very much.

    But I m missing some resource... I have this error...

    The type or namespace name 'IterationStatus' could not be found (are you missing a using directive or an assembly reference?) Cs0246

    The type List<IterationStatus> is not recognized.

    Thanks again

  10. #10
    Moderator
    Join Date
    Oct 2010
    Location
    Norway
    Posts
    3,268
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0
    Oops! Yes, I see that I have missed the namespace.

    Include these statements.

    Code:
    using System.Collections.Generic;
    using HP.ST.Fwk.SOAReplayAPI;
    Rajkumar

 

 
Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 12:36 PM.

Copyright BetaSoft Inc.