Forum Discussion

Alleyn's avatar
Alleyn
Contributor
3 years ago
Solved

Testcomplete parsing an on screen value

Hi, is it possible to parse an on screen value in test complete?

 

Scenario: screen captures the following in one field 2021\6756 - I store this in Variable "Case no"

I then want to use the variable in a search screen but the search screen has the two values split up into "Year" and "Number"

 

What is the best approach to allow me to make use of the "Case No" variable so I can carry out my search?

 

Many thanks.

  • Alleyn's avatar
    Alleyn
    3 years ago

    Hi ebarbera 

     

    Thanks for giving me a steer in the right direction.

    I used the below - it was the Project.Variables.CaseNo that was throwing me. I can now manipulate the values as per your earlier post - thanks again!

    def GetCaseNo():

    Str = Project.Variables.CaseNo

    # Uses the SubString method
    Log.Message(aqString.SubString(Str, 0, 4))
    Log.Message(aqString.SubString(Str, 5, 4))

6 Replies