SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2
  1. #1
    Senior Member
    Join Date
    May 2005
    Location
    Manchester, UK
    Posts
    122
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Defined Output variable from Test Script to Visual

    Hi all,
    I'm a bit confused, I've searched around help and just can't get my head around this-

    I have a test script that captures text in a window (don't ask why - complicated infragistics nonsense that I'm trying to workaround!) and a function that compares the captured text to the text I am looking for and if found returns a value - I've tried boolean and I've tried text - it works within the test script but when I need to pass the result back to the visual test I'm calling it from I can't work out how the defined test script variable (as found when you click on the test script and go to Edit>Define Test Script Variables) passes it there.

    I can create a whole new variable in the Define Test Script Variables dialog, that can only be text or number but is unconnected to the script I just wrote - ie, having just returned a boolean true, or a text found ="Yes" to a variable in the test script I can't then pass it to a variable in the visual test. The trouble is that it's so confusing - you have variables in the test script, the ones you define as inputs and outputs which are an entity to themselves, and a whole another set of local variables in the visual test! I've tried so many things but can't get them hooked up and don't know where I'm gong wrong! Inputs I'm fine with, I can get them going fine....its the Out that's not clear.

    This is my script as converted to string based rather than boolean as I just wanted to take an extra complication away
    he result is that it DoesTextExist returns Yes.....good, now what on earth do I need to do to get 'Yes' to my visual test so that I can decide what to do with that information??? I've tried different variable names to DoesTextExists, the same variable name, but nothing works.

    Sub Main()

    Dim DoesTextExist As String
    'DoesTextExist = False

    DoesTextExist = text()
    MsgBox DoesTextExist

    End Sub

    Function text() As String

    Dim captext As String
    Dim temp As String

    DotNETForm("Sage Practice Solution - Main Application DotNETForm").Attach

    GUIObject(Me.Window).Attach
    captext = GUIObject.CaptureText()
    temp = InStr(1, captext, Me.wantedvalue, vbTextCompare)

    If temp = True Then
    text = "Yes"
    Else
    text = "No"
    End If

    'MsgBox textExists

    End Function
    Using:
    TestPartner 6.3, Visual Tests
    Application under test: Client/Server based, C# .Net App with Infragistics Presentation layer
    Database: SQL 2000/2005

  2. #2
    Junior Member
    Join Date
    Mar 2009
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Defined Output variable from Test Script to Visual

    In your VT, double-click the line that calls TS. Properties of that line will be shown, with all the variables to and from TS listed. You should see there's Output variables where it says "pass contents of ... into" - put your VT local variable here. You can also check the help file on this topic.

    Hope this helps.

 

 

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 06:18 AM.

Copyright BetaSoft Inc.