Scenario status within a python webapp

akember18
Level 1
Scenario status within a python webapp

I have a webapp that changes variables when the user selects them. However i want it to send an error message when the user attempts to change the variables while a scenario is running. I want to write python code to check whether a scenario is running or not.

I am not using an API as it is within a webapp in the project so the usual:

scenario = project.get_scenario('scenario_name')

# Check if the scenario is running

if scenario.running:

         print('SCENARIO ALREADY RUNNING')

else:

         print('NO SCENARIO RUNNING')

 

... is not working. How can I get the status of a scenario without the api client?

0 Kudos
1 Reply