how to run the squish qt test suit from the python script

235 views Asked by At

when trying to run a testsuit from the python script the report generated by squish is always showing RuntimeError: Could not connect to Squish server at host 127.0.0.1, port 4322: Connection refused. for all test cases.

''' if os.path.exists(folder_path): test_suite_names = [current_working_directory+"\test_suits\"+item for item in os.listdir(folder_path)]

commands = [ [squishrunner_path, "--testsuite", test_suite_path, "--testcase", "tst_master", # Specify the test case name "--reportgen", f"html,{report_filename}"] for test_suite_path in test_suite_names ]

Run all commands at once

for command in commands: try: subprocess.check_call(command) except subprocess.CalledProcessError as e: print(f"Error running squishrunner: {e}")'''

1

There are 1 answers

0
Ladislav Šanda On

did you actually run squish server beforehand?

When you run Squish runner by itself it wont start Squish server.

Just call your server in /squish_installation_folder/bin/squishserver and let it run as long as you need it to.