Symptom: a Safari test times out, but the log does not show whether Safari started, a WebDriver session was created, or the test assertion failed.
Fastest route: classify the failure as automation permission, safaridriver or client configuration, session state, or a test defect, then verify each layer in order. A failed test alone does not prove the remote Mac is unreachable. For actual Safari behavior, a passing Playwright WebKit run is not a substitute for Safari WebDriver acceptance.
This guide is for: engineers responsible for browser end-to-end tests who need to separate driver failures from test defects.
CI engineers maintaining macOS test hosts who need evidence about Safari settings and session state.
Developers using a remote Mac to reproduce Safari-specific issues and retain an auditable test record.
00Start with Safari WebDriver remote Mac troubleshooting by locating the failure
Treat the error as a report about the stage that failed, not as a diagnosis. “Timed out” can describe several different events: the client could not reach the host, Safari did not launch, the WebDriver session was never created, or a valid session ran a test that did not finish.
Before changing network rules or reinstalling tools, identify the last confirmed event. This avoids masking a browser or test problem with unrelated infrastructure changes.
Capture these details for each failure:
- The complete client error and stack trace, including the underlying cause if the client reports one.
- The command or CI job that started the test, with the working directory and relevant environment variables.
- Whether the remote host accepted the SSH or other remote connection.
- Whether
safaridriverstarted, whether Safari opened, and whether the client received a session identifier. - The first failed browser action or assertion, not only the final job timeout.
- The target Safari and macOS versions, taken from the actual test host rather than a developer’s local machine.
Do not put passwords, access tokens, signing secrets, or session cookies into shared logs. Keep enough output to establish what happened, but redact credentials before uploading artifacts.
01Check whether Safari and safaridriver can start
Safari WebDriver is Apple’s automation interface for Safari. safaridriver is the driver executable used to connect a WebDriver client to Safari; it is not Playwright’s bundled WebKit browser. Apple documents Safari WebDriver and its associated commands in its Safari WebDriver documentation.
When Safari is installed but automation will not start, check the target host itself. A client running on a workstation cannot establish which Safari installation or driver the remote account is using.
Confirm the host and account
Connect to the same remote Mac and use the same account that runs the job. Check the host identity and the installed Safari version from that account. If an interactive shell works but the CI job does not, compare their PATH, shell initialization, working directory, and permissions. A CI service may launch a non-interactive shell that does not load the same configuration as a terminal session.
Then check whether safaridriver resolves for that account. Record the resolved executable path and the command’s output. If the command is not found, do not assume Safari itself is missing: first establish whether the job’s environment can locate the driver and whether the intended macOS installation provides it.
Apple’s setup guidance describes preparing Safari for WebDriver, including the developer automation permission. Follow the instructions that match the installed system in Apple’s WebDriver testing guide, rather than copying an old command from an unrelated CI image.
Check Safari’s automation permission
On the target Mac, inspect Safari’s developer settings and confirm that remote automation is allowed. The relevant controls are documented in Apple’s Safari developer settings reference and its Safari developer menu guide.
Do not infer that this setting is enabled because Safari launches normally or because a user can browse websites. A regular browser session and a WebDriver-controlled session are different conditions. After adjusting a setting, restart the test process and capture the result; otherwise, an old process may make the change appear ineffective.
If the setting is present but the driver still fails, record the exact driver command, its output, and whether Safari opens. Apple also documents Safari’s Develop menu, which helps confirm whether the expected developer controls are available in the browser.
02Diagnose safaridriver when it is missing or will not launch
A driver launch failure usually calls for an environment check before a test rewrite. Confirm that the job invokes the driver on the remote Mac, not on the client machine, and that it does so under the intended user account. A common source of confusion is a script that starts a local WebDriver client but points to an incorrect host or port, leaving it unclear which side actually failed.
Use the evidence below to narrow the next action:
- The shell cannot resolve
safaridriver: inspect the job’sPATHand user context, then verify the Safari and macOS installation on the host. - The driver runs but reports an automation or permission error: verify Safari’s developer automation setting and repeat the test after restarting the relevant process.
- The driver starts but Safari never appears: examine the driver output and host session state. Check whether the job runs in the expected user session and whether another process is interfering.
- Safari appears but the client reports a connection or protocol error: verify the WebDriver endpoint and client configuration. A browser window alone does not prove the client successfully created a session.
- The session starts and a browser action fails: preserve that action and its result. At this point, investigate the test, page state, and browser behavior rather than treating the issue as a driver startup failure.
Apple’s reference for Safari WebDriver commands describes the commands available for Safari automation. Use it to validate the operation being attempted; do not assume that a flag used with another driver has the same effect with safaridriver.
03Check session creation before investigating a test timeout
A driver that can run is not necessarily a driver that can create a usable Safari session. Separate the client’s request to create a session from the browser actions that follow it. Save the client’s capabilities, the driver startup output, and the first response returned after the session request. Redact credentials and other sensitive values before storing the record.
Check these conditions in order:
- Client configuration: confirm the test client is using a Safari-supported WebDriver configuration and that the request is sent to the intended endpoint. Remove browser-specific options that belong to another automation framework until a minimal session has been tested.
- Automation authorization: verify the Safari permission on the host. If the driver prompts for or requires a setting change, record that separately from network availability.
- Host identity: confirm the job reached the expected Mac and is using the expected user account. A session created on a different host is not evidence that the intended test environment is healthy.
- Session availability: check whether another job or user is already controlling Safari. Apple describes Safari’s WebDriver behavior, including its automation window and limits on concurrent active sessions, in its WebDriver testing guidance. Treat contention as a condition to investigate, not as the presumed cause of every timeout.
- Human input: ask whether someone used the same machine during the run. Mouse or keyboard input can change browser state, dismiss prompts, or interfere with a test that expects exclusive control.
If session creation fails before Safari opens, the test’s assertions are not yet the primary suspect. If the session exists and the browser has opened, move down the stack: inspect the current URL, browser console output where available, the last completed action, and the assertion that stopped the run.
04Investigate a session that hangs or stops unexpectedly
Once a session has been created, treat a hang differently from a launch failure. First establish whether the Safari window is still open and whether the job is waiting on a browser command, a page condition, or an external dependency such as a test server. A job-level timeout does not identify which of those is responsible.
Then check for session reuse or contention. A shared runner can make failures intermittent if separate jobs or manual debugging interact with the same browser session. Keep one test run isolated while diagnosing the problem; if the failure disappears, investigate how sessions are allocated before changing the test assertions.
For interrupted runs, compare the last successful browser command with the first missing event. Look for a dismissed dialog, navigation that never completed, an unavailable page dependency, or a process that exited while the client still expected a response. Save the browser and driver output together so the timeline can be reconstructed. Do not call a failure “network-related” unless the logs show a connection failure at the relevant stage.
A useful record includes the start time, host identity, account, target browser, session creation result, last completed action, and final error. The purpose is not to collect logs indiscriminately; it is to let another engineer distinguish “could not create a Safari session” from “created a session, then waited for a page condition.”
05Separate a WebKit pass from Safari WebDriver acceptance
Playwright WebKit tests can be valuable as an early browser-engine check, but they do not prove that the target Safari browser passes. Playwright documents that its WebKit browser is not identical to branded Safari, and that its browser builds and release cadence differ from installed browsers. See the Playwright browser support documentation and its browser configuration guide.
Use the two results for different purposes:
- Keep Playwright WebKit as a fast check for the coverage it actually provides.
- Reproduce Safari-specific acceptance failures with Safari WebDriver on the target Safari installation.
- Record which browser executed each test. Do not label a WebKit result as a Safari result.
- If WebKit passes but Safari fails, compare the failing action, browser version, page behavior, and driver logs before deciding whether the cause is application code, browser behavior, or automation setup.
This distinction also answers a frequent CI trap: a passing WebKit job can establish that one test passed in Playwright’s WebKit environment. It cannot establish that a real Safari WebDriver session was created, or that the same behavior passes in the Safari version used for release validation.
06Choose the next action from the evidence
Use these conditional branches after collecting the basic logs:
- If the remote host cannot be reached or the remote command never runs, troubleshoot the access path and job-to-host connection first. Do not change Safari settings until the job executes on the intended Mac.
- If the host is reachable but the job cannot find or launch
safaridriver, check the account, executable resolution, Safari installation, and driver output before editing the test. - If the driver launches but no WebDriver session is returned, verify Safari automation permission, client configuration, endpoint, and whether another active session may be present.
- If a session exists and a specific browser action or assertion fails, investigate the test and page state. Keep the driver setup unchanged until a minimal Safari test confirms a separate setup failure.
- If Playwright WebKit passes but Safari acceptance fails, run the failing case through Safari WebDriver. Retain both reports, clearly labeled, instead of treating the WebKit pass as a Safari sign-off.
The tables below make those branches easier to hand off between test authors and CI maintainers. They are diagnostic aids, not claims that any one symptom has a single cause.
| Observed symptom | Evidence to capture | First check |
|---|---|---|
| Remote command does not run | Connection result, host identity, job output | Remote access and job targeting |
safaridriver is not found |
Account, PATH, executable resolution |
Job environment and Safari installation |
| Driver starts but session is rejected | Driver output, client capabilities, Safari setting | Automation permission and client configuration |
| Session exists, then the test hangs | Last completed action, open window, concurrent activity | Test wait condition and session isolation |
| WebKit passes, Safari fails | Separate browser labels and failure traces | Reproduce the case with Safari WebDriver |
| Checkpoint | Pass evidence | If it fails |
|---|---|---|
| Host selection | Logs identify the intended remote Mac | Correct job targeting before changing browser configuration |
| Driver startup | safaridriver runs under the job account |
Compare account and shell environment |
| Safari authorization | Automation permission is enabled in Safari settings | Apply the documented setting, then restart and retest |
| Session creation | Client receives a Safari WebDriver session | Inspect endpoint, capabilities, and session availability |
| Test execution | Logs show the last completed browser action | Investigate the action, page state, or assertion |
| Testing need | Better fit | Trade-off to account for |
|---|---|---|
| Quick browser-engine checks | Playwright WebKit | Does not establish behavior in branded Safari |
| Safari-specific acceptance | Safari WebDriver on a Mac | Requires a usable Safari host and its automation setup |
| Repeated CI validation | An isolated Mac runner | Requires runner maintenance and control of session contention |
| Occasional reproduction without a local Mac | A remote Mac environment | Depends on verifying that the required macOS and Safari versions are available |
Before accepting a result, retain enough evidence to reproduce the same path: the host’s actual Safari and macOS versions, the WebDriver client configuration, whether the automation permission was enabled, the session creation result, and the first failing browser action. Do not infer broad Safari compatibility from one unqualified run. A result applies to the environment and test that produced it.
If the current setup is a Windows or Linux workstation, it cannot run the installed Safari browser locally; a WebKit substitute still leaves a browser-identity gap. A shared developer Mac can introduce contention with interactive work, while maintaining a dedicated Mac runner requires hardware, updates, and CI administration. A remote Mac can provide a separate place to run real Safari tests without buying and managing another machine, but it is not automatically the right choice for continuous heavy workloads or tests that require physical peripherals.
For a short-term reproduction or an isolated Safari acceptance job, review the NUKCLOUD remote Mac overview and confirm that its currently listed macOS, Safari, and access conditions match the test requirement before proceeding. If those conditions fit, the NUKCLOUD Mac options can be evaluated against the cost and operational burden of maintaining a dedicated host. Keep the decision tied to the evidence: use Safari WebDriver for Safari sign-off, and use WebKit results only for the coverage they actually demonstrate.