Forum Discussion

par_away's avatar
par_away
Occasional Contributor
9 years ago
Solved

Getting a Type Mismatch error when using a Project Suite variable as input for SetText operation

So I have 2 keyword tests (KT1 and KT2) and a project suite variable (Var1), using the Set Variable Value operation, I assigned the value of Var1 with type Object. This variable gets the Text propert...
  • Colin_McCrae's avatar
    9 years ago

    You've set the variable to a type of object.

     

    But you only want the text property of an object stored in it.

     

    Thats a string. So you need to set the variable type to string as you're using it store a property of an object (a string in this case), not the object itself. A string should be usable for text entry elsewhere without any problems.

     

    (And I would recommend using "Keys" rather than "SetText" as it's what the user would do when entering text. SetText applies it directly to the control and may not activate any event triggers attached to the field or be retained when you exit the field.)