Skip to main content

Unable to execute tests on localhost with TestCloud Tunnel

Execution with TestCloud and TestCloud Tunnel fails on locally hosted sites. In this case, the report screenshot might show that the test fails to load the local site as follows:

The workaround is to set an additional domain for your local address (127.0.0.1) and use that domain, instead of localhost, in your tests.

In most operating systems, domains can be set in the hosts file. The following remedy shows you how to set the additional domain.

  • On Windows:
    1. Navigate to the C:\Windows\System32\Drivers\etc\hosts file.
    2. Open the file in an editor with administrator privilege.
    3. In the file, add another domain for 127.0.0.1.
      For example, we add the mydomain domain name.
    4. Open the file again to verify that the changes have been updated.
  • On macOS:
    1. In your terminal, open the hosts file with an editor.
      Here we use nano to open the host file at /private/etc/hosts.
      sudo nano /private/etc/hosts
    2. Add the new domain name into the file.
      127.0.0.1       mydomain
    3. Save the file. With nano, use Ctrl + X then Y to save the file.
    4. Open the file again to verify the changes.
      cat /private/etc/hosts  
  • On Linux:
    1. In your terminal, open the hosts file with an editor.
      sudo nano /etc/hosts
    2. Add the new domain name to the file.
      127.0.0.1       mydomain
    3. Open the file again to verify the changes.
      cat /etc/hosts
Was this page helpful?