When asked to make some types of connection to localhost or 127.0.0.1, Safari may ignore any configured proxy. This may cause Safari to not fetch traffic via Sauce Connect, causing tests to fail.
To prevent this, use a different hostname for the system under test. You can either use the existing hostname of the system, or set a new hostname just for testing purposes. This does not need to be a 'real' hostname; you can make up a name and have it resolve to 127.0.0.1, and it'll work fine.
- This article from Microsoft describes how to add a hostname on Windows.
- This article from OS X Daily describes how to add a hostname on Mac.
- This article from LinuxIssues.org describes how to add a hostname on Linux.
For instance, if you wanted to use the hostname localtest.dev,
you would add this to your host file:
localtest.dev 127.0.0.1
If you're using a test runner, you'll also need to configure it to use the new hostname instead of localhost. Check out our sample test runner setups for more information on how to configure your test runner to work with Sauce Labs.