How to call test methods with Python module squishtest?
-
Hi there. I'm currently evaluating the Python module
squishtestwith Squish for Web 9.1.1 on Ubuntu 22.04. I followed the setup as described in Using Squish as a module in other Python scripts, applications. Setup worked for me.I would like to test a web application.
startBrowser(url)works as expected. However, when I try to call one of the test methods, e. g.test.compare(value1, value2), it does not work. The test report is empty. No fails, no passes. I tried callingsquishtest.test.compare()instead, but it doesn't work either. See script below.Could somebody please give an example how to call the test methods with module
squishtest. Thanks in advance.import squishtest squishtest.setTestResult("html", "testresultdir") squishtest.testSettings.setWrappersForApplication("__squish__webhook", ["Web"]) squishtest.startApplication("__squish__webhook") squishtest.startBrowser("https://www.google.com/") squishtest.waitForApplicationLaunch() # test.compare("Start", "Stop") # doesn't work squishtest.test.compare("Start", "Stop") # does not work either -
Hi there. I'm currently evaluating the Python module
squishtestwith Squish for Web 9.1.1 on Ubuntu 22.04. I followed the setup as described in Using Squish as a module in other Python scripts, applications. Setup worked for me.I would like to test a web application.
startBrowser(url)works as expected. However, when I try to call one of the test methods, e. g.test.compare(value1, value2), it does not work. The test report is empty. No fails, no passes. I tried callingsquishtest.test.compare()instead, but it doesn't work either. See script below.Could somebody please give an example how to call the test methods with module
squishtest. Thanks in advance.import squishtest squishtest.setTestResult("html", "testresultdir") squishtest.testSettings.setWrappersForApplication("__squish__webhook", ["Web"]) squishtest.startApplication("__squish__webhook") squishtest.startBrowser("https://www.google.com/") squishtest.waitForApplicationLaunch() # test.compare("Start", "Stop") # doesn't work squishtest.test.compare("Start", "Stop") # does not work eitherFound it. I overlooked the following traceback in the logs.
Traceback (most recent call last): File "/mnt/ssd2/develop/experiments/python-squish/mysquishtest.py", line 16, in <module> squishtest.waitForApplicationLaunch() RuntimeError: Waiting for application timed outWhen I remove the call
squishtest.waitForApplicationLaunch()it works and I can usesquishtest.test.compare()to test conditions. -
M Markus KS. has marked this topic as solved