Using local variable in Script Routine.
Hello all,
In my keyword test I use Run Script Routine. The script should click on the QT button, the value of the button stored in the csv file under "TC_Organism_button" column. I'm trying to parametrize the script routine that when I want to click different button I need to change the value of the button only in csv file not in test.
In script routine I have variable which uses local keyword variable as a value:
# Get the CSV file path from the 'test_variable' keyword test variable
csv_path = KeywordTests.CurrentTestItems.Variables['test_variable']
# Call the function to click the button using the object path from the first row of the CSV file
click_organism_from_csv(csv_path)
Then in script routine as a parameter I specify the column as a value - "TC_Organism_button".
Then when I'm running the script routine I get the error:
What does this error mean and how to fix it?
Is this the same issue as https://community.smartbear.com/t5/TestComplete-Questions/Test-execution-fails-after-I-modified-variable-of-a-ClickButton/td-p/251645 ?
You need to use the eval() function to evaluate the JavaScript code represented as a string
In your CSV file, how have you defined the actual button name?
You have defined the following,
which doesn't match with the code you have written
and your comment "# Get the CSV file path from the 'test_variable' keyword test variable" doesn't match which what you are trying to do - which is confusing