Reputation: 13
I am trying to connect my computer running TestComplete to a different computer running an Appium server. Currently, I am finding the IP address of the Appium computer via Settings -> WiFi -> Details -> IP Address. Then, I throw this address into TestComplete's 'Connect to Device' Server URL. This looks like "http://01.23.456.789:4723/wd/hub". I want to change it to use 'local' host instead of the direct IP Address as mentioned in this question: I have to specify my local Appium server URL. Where/How can I find the URL?.
When I change my Server URL in TestComplete to looks like: "http://localhost:4723/wd/hub" I get the error: "A connection with the server could not be established". When starting Appium, the host looks like: "0.0.0.0". Leaving this as is and changing it to "localhost" both do not fix my issue. What else is needed in addition to the previously mentioned stack overflow question do I need to do to fix my issue?
Upvotes: 1
Views: 912
Reputation: 36
When the machine running TestComplete uses localhost
to start a connection, it is sending a request to itself. Since the appium service isn't running on the same machine as TestComplete, that request will fail.
If what you want to avoid is using an IP address, and you'd rather use more friendly machine names, then you have two options;
If your network is using an internal name service (DNS) then each machine probably already has a proper name as well as an IP address. You can ask your network admin or use tracert <IP address>
(without the angle brackets) to see if a name for that machine is known or available.
If no name is set within the network, then you can create a friendly alias for that IP Address within the Hosts file of the machine running TestComplete;
C:\Windows\System32\drivers\etc\hosts
<IP Address> friendlyname # This machine hosts appium
http://friendlyname:4723/wd/hub
from TestComplete to reference the Appium serverUpvotes: 0
Reputation: 61
localhost only works for devices connected directly to the TC machine.
Upvotes: 1