Getting AUT's host address from test script?
-
Hi,
I am running Squish tests on a device, where I have my Qt application running. I use the local squish server to attach to the remote application, so I have entered the device's IP address in the Squish IDE Server Settings. I am using the device's IP address in some of the test scripts, e.g. when sending ssh commands to the device, so it would be nice to be able to get the device's IP address from the Server Settings in the test scripts, but so far I haven't found a way of doing this. Does anybody know how to do this? Our test scripts are in Python.
Thanks,
Bo -
Hello @Bo-Elmgreen
To get the device IP address I would use ApplicationContext object and read the SQUISH_SERVERADDRESS environment variable.
ctx = attachToApplication("xyz") host = ctx.environmentVariable("SQUISH_SERVERADDRESS")
I hope this helps :)
-
-
Hi @TomaszPawlowski ,
Sorry for the late answer!
Well, in my case the squish server runs on my laptop - and not on the device where the AUT is running - so I would get the laptop's IP address if I queried the SQUISH_SERVERADDRESS... Do you know what I could do in my setup?Thanks!
Bo -
-
You can query the squishserver configuration, for example with "squishrunner --info all", or "squishrunner --info attachableApplications". Depending on the setup, you may need to specify the --host and --port options to squishrunner, to tell it which squishserver to connect to. (The default squishserver can be determined via "defaultApplicationContext().host" and "defaultApplicationContext().port".)
-
-