# docsApple Safari: Mac Configuration

Following steps are necessary to improve AIQ compatibility with MacOS systems. The below step 1 will address a known issue slowing Java 8 applications with macOS Sierra and newer. Other points are necessary to be able to record and playback on native Safari browser.

## 1. From MacOS Sierra to latest Mojave, this configuration is required:

- Type "hostname" in a terminal window. This should return your &lt;system canonical name&gt;. It should look similar to Joe-MacBook-Pro.local
- Enter the hostname obtained in the first step into your /etc/hosts text file. To do so please type in a terminal  
    `sudo nano /etc/hosts`  
     Then add these two lines  
    `    127.0.0.1 <system canonical name>`  
    `    ::1 <system canonical name>`  
     Make sure to replace &lt;system canonical name&gt; with the value returned by the command in the first step. Save your file, and retry executing your script in test designer.
 
## 2. Removing sudo password requirement for *networksetup* command

The mac’s *networksetup* command is used by the Test Designer client to automatically set and unset the MacOS network proxy for the "Wi-Fi" connection, required to record and playback using the Safari browser. This command requires *sudo* credentials, so normally it requires the mac user to provide his password.

To avoid the user to have to write his password, you need to edit a file in macOS X, using the following steps:

1. Open a Terminal and type:
 
> sudo visudo

(This opens a special vi editor to change this text file. It is important to not use a normal text editor, as this one prevents any syntax error from being saved. That could cause sudo functionality to brake)

1. When prompted, provide your password
 
1. Press “
 
**i**” to activate the "insert" mode and using arrow keys, move the cursor to search for the following line

*%admin ALL=(ALL) ALL*

1. 
 
<u>Below the above line</u>, type:

> &lt;your\_username&gt; ALL=(root) NOPASSWD: /usr/sbin/networksetup

(replace &lt;*your\_username&gt;* with your user name. If you don't know which is your user name, just open a terminal window as type **echo $USER,** that will print out your user name)

1. Press
 
**ESC** key to leave insert mode and then type **:wq** to exit the editor (that is colon w q)

#### Do not use your Mac while running tests, as AIQ will use keyboard commands to close the running browsers that could get applied to a different application if you are using the system during a test.  


## 3. System Preferences

- In the Security &amp; Privacy preference, select the Privacy section and add the Terminal and the ScriptEditor applications to the apps that are allowed to control your computer.
- In Security &amp; Privacy add the Script Editor application to the Privacy &gt; Accessibility permissions
- In the General section, set the system to close windows after quitting an app
    
    And select Safari as your default browser:
- In Network, proxy settings, set the Bypass Proxy Settings to localhost:8080.
 
 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/4QDmTVx0EaOPaf2u-8a3e8a0a8d1a.png)

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/khbZUbhysPqN94a7-2375ed401835.png)

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/NOY46zChbw0iUfwa-cc25187bbb25.png)

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/dhDy2EChUOIChiOy-b434a3ce7233.png)

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/wu24MsYjoicL486x-f84e54236ac9.png)

## 4. Safari Preferences

Disable **NSULSession WebSocket** experimental feature

- Open the Safari Preferences → Go to the Advanced tab, and check "Show Develop menu in menu bar".
 
 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/f6JW02kyet5P0iJo-0d3ec24b4317.png)

- Go to Develop → Experimental Features → look for **NSULSession WebSocket** and ensure that the option doesn't have a *checkmark.*
 
 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/SzdzhlwgRFOlV7MM-8ad59dd010f2.png)

Set Safari opens with: A new private window.  
New window opne with: Empty Page  
New tabs open with: Empty Page

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/CPXmxQfo2qVwUvIi-0cce106c17b3.png)

Select "When a new tab or window opens, make it active" in Tabs section

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/xhzhSDIdR1QP36FR-b76c4bd09bd0.png)

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/g9eV4Mt4oeVeCtQL-38767ee341de.png)

<div id="bkmrk-last-updated%3A-march-">---

Last updated: <span class="mc-variable General.NewDateTimeVariable variable">March 31, 2025</span>

If you have any feedback on this topic, please contact us at <documentation@appvance.ai>

</div>