Forum Discussion

John_Laird's avatar
John_Laird
Contributor
8 years ago
Solved

code snippet throws exception where same logic in script routine does not

My goal is to read a text file and set it to a variable in my keyword test. Simple. Got it done but noted an inconsistency between script routines and code snippets and wanted to understand why...  ...
  • tristaanogre's avatar
    8 years ago

    Since you are doing a keyword test anyways, is there a reason why you are not setting the variable using the "Set Variable Value" keyword? When you do so, you have the option to set the value to the result of a code expression. You can then enter in the code expression your aqFile part of the code and that should work.  See the attached screenshot for reference.