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
    Sep 2008
    Posts
    108
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Project suite variables

    I dont know if this is the best way to approach this so any help is appreciated.

    We are running two sets of reports from two builds to ensure that the latest build hasnt broken anything. I need to pass in variables for the file names and file locations etc and thought that using the Project Suite variables page would be a good place. When I run my script however it does not pull in the variables from the suite. I cant find any help pages or samples that actually show how you use the variables. What have I missed?

    If there is a better way of doing this then please let me know, although I still want to know how to get the variables to work!

    Thanks

    Steve W [img]/images/graemlins/laugh.gif[/img]

  2. #2
    Senior Member
    Join Date
    Jul 2008
    Posts
    1,049
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Project suite variables

    Hi Steve,

    >>>I cant find any help pages or samples that actually show how you use the variables
    Please see the "Local Variables" and "Working With Local Variables in Scripts" help topics. If this suggestion does not help you solve the problem, please zip your entire TestComplete project suite folder along with the failed test execution log and send the archive to us via our Contact Support Form (http://www.automatedqa.com/support/message.asp) so we can investigate the problem on our side.
    Regards,
    Allen - SmartBear Support

  3. #3
    Senior Member
    Join Date
    Sep 2008
    Posts
    108
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Project suite variables

    Allen

    Thanks for that. I did find the relevant help pages and somehow worked out how to get the variables added in the script and set the values.
    I now need to retrieve the values to use but the values are null.

    Example using VB:
    'Project.Variables.AddVariable "folder", "String"
    'Project.Variables.AddVariable "file1", "String"
    'Project.Variables.AddVariable "file2", "String"

    'Project.Variables.VariableByName("folder") = "C:\Dummy"
    'Project.Variables.VariableByName("file1") = "test rpt b4 csv.xls"
    'Project.Variables.VariableByName("file2") = "test rpt After csv.xls"

    I then try to compare the two:

    If (Not Files.Compare((folder+file1), (folder+file2), 0, True)) Then
    Call Log.Error("The files are not identical.")

    I thought that I needed to prefix each variable with Project.Variable. but that still gave me null values.

    Thanks

    Steve

  4. #4
    Senior Member
    Join Date
    Jul 2008
    Posts
    1,049
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Project suite variables

    Hi Steve,

    There is no way to address project variables directly by their names because their names can coincide with the names of your script variables. Therefore, you always need to use the Project.Variables.MyVar notation. Besides that, the file names you are using are incorrect: you are comparing "C:\Dummytest rpt b4 csv.xls" with "C:\Dummytest rpt After csv.xls".
    Regards,
    Allen - SmartBear Support

  5. #5
    Senior Member
    Join Date
    Sep 2008
    Posts
    108
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Project suite variables

    Thanks for your reply.

    I will use the Project.Variables.MyVar notation and see how that works.

    Steve

 

 

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 11.54%
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 10:04 PM.

Copyright BetaSoft Inc.