Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. QA Tools
  3. Squish
  4. Getting AUT's host address from test script?
QtWS25 Last Chance

Getting AUT's host address from test script?

Scheduled Pinned Locked Moved Solved Squish
5 Posts 3 Posters 1.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bo Elmgreen
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • T Offline
      T Offline
      TomaszPawlowski
      wrote on last edited by
      #2

      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 :)

      ⚙ Test Automation Consultant
      https://cyberalpaca.com - Qt Test Automation experts
      https://www.linkedin.com/in/tomaszpawlowski/

      B 1 Reply Last reply
      0
      • C clanhuth has marked this topic as solved on
      • T TomaszPawlowski

        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 :)

        B Offline
        B Offline
        Bo Elmgreen
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • B Bo Elmgreen has marked this topic as unsolved on
        • C Offline
          C Offline
          clanhuth
          wrote on last edited by
          #4

          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".)

          1 Reply Last reply
          0
          • C clanhuth has marked this topic as solved on
          • B Offline
            B Offline
            Bo Elmgreen
            wrote on last edited by
            #5

            Hi @clanhuth,

            Thanks for the advice! I will look into this.

            Cheers,
            Bo

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved