SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    Aug 2001
    Location
    Manchester, NH
    Posts
    121
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Is there a way to generate GUIDs in TestComplete?

    Does anyone know if there is a way to generate GUIDs in TestComplete? I didn't find anything in help or in a forum search.

    Thanks,
    Adam

  2. #2
    Senior Member
    Join Date
    Aug 2001
    Location
    Manchester, NH
    Posts
    121
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Is there a way to generate GUIDs in TestComple

    I dug around online some more and found this VBScript code that works in TestComplete.

    <font class="small">Code:</font><hr /><pre>
    sub GenerateGUID
    Set TypeLib = CreateObject("Scriptlet.TypeLib")
    NewGUID = TypeLib.Guid
    log.message(left(NewGUID, len(NewGUID)-2))
    Set TypeLib = Nothing
    end sub
    </pre><hr />

    Of course we do our work in DelphiScript, so this isn't ideal, but it will work. If someone knows of a DelphiScript solution i'd be interested in that.

    Thanks,
    Adam

  3. #3
    Senior Member
    Join Date
    Oct 2003
    Posts
    928
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Is there a way to generate GUIDs in TestComple

    Hello Adam_NH,

    In DelphiScript, you can generate a GUID in the same way. To create an instance of the Scriptlet.TypeLib object, you can use the OleObject property of the Sys object. Please see the "Sys.OleObject" help topic for details.

    The DelphiScript version of the GenerateGUID routine will look like this:

    <font class="small">Code:</font><hr /><pre>
    // DelphiScript
    procedure GenerateGUID;
    var TypeLib, NewGUID;
    begin
    TypeLib := Sys.OleObject['Scriptlet.TypeLib'];
    NewGUID := TypeLib.Guid;
    Delete(NewGUID, Length(NewGUID)-1, 2);
    Log.Message(NewGUID);
    end;
    </pre><hr />
    Regards,
    Alex - SmartBear Support

  4. #4
    Senior Member
    Join Date
    Aug 2001
    Location
    Manchester, NH
    Posts
    121
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Is there a way to generate GUIDs in TestComple

    That's great, thank you.

  5. #5
    Junior Member
    Join Date
    May 2008
    Location
    SF Bay Area
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Is there a way to generate GUIDs in TestComple

    Agreed, Thank You! keeping this in my back pocket! [img]/images/graemlins/smile.gif[/img]
    "No matter where you go, there you are." - Buckaroo Banzai

    "Who would throw a shoe?!" - Austin Powers

 

 

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 © 2016 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 © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 05:50 AM.

Copyright BetaSoft Inc.