NEW RESEARCH We surveyed 100+ QA Leaders on AI in Testing. See how your team compares.
Get the Report

Ship bug-free apps on real devices, in the cloud.

Trusted by 2 Mn+ QAs and developers to accelerate release cycles—manual, automated, and AI-powered testing on 5,000+ real Android and iOS devices.

Pcloudy digital experience testing platform
Cross Browser Testing

Live Cross Browser Testing and Debugging On Safari Browser

Reviewed by Archana Gupta Archana Gupta

Safari is the second most used browser in the world. StatCounter puts it at 18.27% of global traffic in September 2026, behind Chrome at 66.36%. Safari handles rendering, its WebKit JavaScript engine and storage APIs differently from Chrome and Firefox, so a page that passes in Chrome can still break in Safari. 

This guide covers what you need to test and debug Safari properly: setting up SafariDriver on a Mac, running your first Selenium test, debugging with Web Inspector, and debugging on real iOS devices with the Pcloudy Safari Debugger. If you only want to open a page in Safari and click around, without writing any code, go straight to test on safari browser.

Three ways to test on Safari 

  • On your own Mac. Free, and fine for quick checks. You get one Safari version, the one your macOS ships with. The setup is in the next section. 
  • On Mac machines in the cloud. Run the same Selenium test on different macOS and Safari versions in parallel. See “Run Safari tests in parallel on Pcloudy browser cloud” below. 
  • On real iOS devices. Check how your site behaves in Safari on an iPhone or iPad, and inspect it live. See “Debug Safari on real iOS devices” below. For manual, no-code testing, use test on safari browser.

Safari vs WebKit: what counts as testing on Safari 

Some tools test with WebKit, the engine behind Safari, instead of the Safari browser itself. WebKit builds such as the one bundled with Playwright are useful for early, cheap coverage, but they are not the branded Safari browser. Safari on macOS and iOS adds its own browser behaviour, settings and OS integration on top of the engine. 

A practical split: use WebKit-based runs in development for fast feedback, and use real Safari on macOS and on real iPhones or iPads for the flows where a Safari bug would cost you, such as sign-in, checkout and forms. The rest of this guide covers real Safari. 

Set up SafariDriver on a Mac 

To automate a browser with Selenium you normally download its driver: ChromeDriver for Chrome, GeckoDriver for Firefox. Safari is the exception. As the Selenium documentation puts it, the safaridriver “is installed with the Operating System”. Safari has had native WebDriver support since Safari 10, so there is nothing to download and no driver path to set. 

You do need a Mac. Apple stopped supporting Safari on Windows in 2012, and the last Windows release was Safari 5.1.7. 

To turn on automation, run this once in Terminal: 

safaridriver --enable

If the command fails with a permissions error, run it again with sudo. [Confirm the admin-password and sudo wording on Apple’s current “Testing with WebDriver in Safari” page. Apple’s page did not load during research.] 

If you prefer the menus, or you are on an older macOS, do it by hand: 

  1. Make the Develop menu visible. In Safari, open Settings, go to Advanced, and turn on “Show features for web developers”.
  1. Choose Develop, then Allow Remote Automation. 
  1. Authorize safaridriver by running /usr/bin/safaridriver once and following the authentication prompt. 

How Safari WebDriver sessions behave 

Safari runs automated tests differently from a normal browsing session. Four behaviours are worth knowing before you write a test. 

  • Isolated automation windows. Tests run in special Automation windows that are separate from your normal browsing windows. Each session starts clean, so one test run cannot affect the next. 
  • A glass pane. While a test runs, Safari puts a transparent “glass pane” over the Automation window. Stray mouse or keyboard input is blocked, so you cannot disturb the test by accident. If a test gets stuck, you can break the glass pane to stop the session. 
  • One session at a time. Only one WebDriver session can be attached to a Safari instance at a time. This keeps simulated mouse, keyboard and touch input realistic and stops tests competing for focus. To run tests in parallel you need more than one machine, which is what a browser cloud gives you. 
  • Web Inspector works during tests. The console, the Elements tab and the script debugger are all usable while a WebDriver test runs. The automaticInspection capability opens Web Inspector and the JavaScript debugger for you, or you can put a debugger; statement in the page you are testing. 

Your first Safari test with Java and TestNG 

This test opens the Pcloudy home page in Safari and checks the page title. You will need: 

  • Java (JDK) and an IDE such as IntelliJ IDEA or Eclipse 
  • The Selenium Java client dependency 
  • The TestNG dependency 
import org.openqa.selenium.WebDriver; 

import org.openqa.selenium.safari.SafariDriver; 

import org.testng.Assert; 

import org.testng.annotations.AfterClass; 

import org.testng.annotations.BeforeClass; 

import org.testng.annotations.Test; 

public class SafariTest { 

    private WebDriver driver; 

    @BeforeClass 

    public void setup() { 

        driver = new SafariDriver(); 

    } 

    @Test 

    public void verifyHomePageTitle() { 

        driver.get("https://www.pcloudy.com/"); 

        Assert.assertTrue(driver.getTitle().contains("Pcloudy"), 

                "Home page title does not contain the brand name"); 

    } 

    @AfterClass 

    public void tearDown() { 

        driver.quit(); 

    } 

}

What the code does. Safari is represented by SafariDriver in the org.openqa.selenium.safari package. Like ChromeDriver and FirefoxDriver, you instantiate it and start testing. Because the driver ships with macOS, you do not specify a driver path. The test loads the page, checks that the title contains the brand name, and quit() closes Safari when the class finishes. The check looks for the brand name instead of the full title, so the test does not fail every time the page title is reworded. 

To run against Safari Technology Preview, pass options: SafariOptions options = new SafariOptions(); options.setUseTechnologyPreview(true); driver = new SafariDriver(options);. Technology Preview must be installed on the Mac. 

For more on writing Selenium tests, see [link: Selenium WebDriver as your first choice for automation testing] and [link: Test automation using Selenium ChromeDriver]. 

Debug Safari with Web Inspector 

There are three ways to inspect a page in Safari. Which one fits depends on whether you need a Mac, a physical iPhone, or neither. 

Safari on your Mac 

With the Develop menu visible, choose Develop, then Show Web Inspector, or press ⌥⌘I. [Confirm the shortcut on current macOS.] You get the Elements tab, the console, network requests and the script debugger. This also works while a WebDriver test is running, as described above. 

Safari on an iPhone, from your Mac 

You need an iPhone or iPad, a Mac with Safari, and a USB cable. On the Mac, the Develop menu must be switched on in Safari’s Advanced settings. 

  1. On the iPhone, open Settings, tap Safari, scroll to Advanced and switch Web Inspector on. 
  1. Connect the iPhone to the Mac with a USB cable. 
  1. Open Safari on the Mac. The iPhone’s name appears in the Develop menu. Pick it, then pick the page you want to inspect. 

This works well when you have the device on your desk. It does not help when you need another iOS version, or a device you do not own. 

If your iPhone does not appear in the Develop menu 

  1. On the iPhone, check that Web Inspector is on under Settings, Safari, Advanced. 
  1. Unlock the iPhone and tap Trust if it asks whether to trust this computer. 
  1. Open the page in Safari on the iPhone first. The device lists only pages that are open. 
  1. Check that the Develop menu is switched on in Safari on the Mac, then reconnect the cable. 
  1. Try a different cable or port. Some cables only charge. 

[QA to spot-check this list on a Mac and an iPhone. It reflects standard Safari Web Inspector behaviour; Apple’s current page did not load when fetched.] 

Safari on an iPhone without a Mac 

Web Inspector on a physical iPhone needs a Mac. If you work on Windows or Linux, or do not have a Mac nearby, use a real iOS device in the cloud instead. You get the device and the inspector in the browser, with nothing to connect. 

Safari on a real iOS device in the cloud 

That is what the Pcloudy Safari Debugger is for. The next section covers it. 

Debug Safari on real iOS devices with the Pcloudy Safari Debugger 

The Safari Debugger lets you inspect web pages and apps in Safari on real, cloud-hosted iOS devices, with full Web Inspector tools. The latest version shows the device screen next to the page’s DOM, so you can match what you see on the phone to the HTML behind it.

debug safari on real ios devices with the pcloudy safari debugger

What you can do in it: 

  • Inspect the DOM and CSS. Select elements, read the live HTML and CSS, and check responsive layouts in real time. 
  • Watch network traffic. Capture HTTP and HTTPS requests, response headers, payloads and API status codes from the Safari session. This helps when a bug comes from the backend or the network and not from the page. 
  • Use the console. Read console logs, track errors and warnings, and run scripts in the console to find client-side exceptions. 
  • Isolate iOS-specific issues. Because Safari handles rendering, its JavaScript engine and storage differently from Chrome and Firefox, the debugger helps pinpoint styling, performance and rendering glitches that only happen on iOS. 
Network panel in the Pcloudy Safari Debugger on a real iPhone, showing a request with headers and a 200 OK status.
Console panel in the Pcloudy Safari Debugger on a real iPhone, listing errors from the loaded page

To start: 

  1. Connect to an available iOS device. 
  1. In the left panel, select Safari Debugger. 
  1. Click Start to open the debugger, then inspect any element in the Safari browser. 

Read more:

What to check on iPhone Safari 

When a page breaks only on an iPhone, work through this list: 

  • Layout and CSS. Media queries, viewport units, fixed and sticky elements, and safe areas on notched screens. 
  • Orientation. Rotate the device and check that the layout and any scripts that read the screen size still behave. 
  • Touch. Taps, swipes and form fields. Check the keyboard does not cover inputs. 
  • Console errors. Open the Console in Web Inspector and look for JavaScript errors that do not appear in Chrome. 
  • Safari privacy settings. Pop-up blocking and cross-site tracking prevention can break sign-in flows, embedded content and third-party scripts. 
  • Network. Throttle or switch to a slower connection and check the page still loads and works. 
  • iOS versions and models. A bug can appear on one iOS version only, so check more than one. 

Run Safari tests in parallel on Pcloudy browser cloud 

One Safari session per Mac is a limit when you have a long list of Safari and macOS versions to cover. The Pcloudy browser cloud runs your Selenium tests on real Mac machines in parallel, across macOS and Safari versions, and can record logs, screenshots and video for each run. It supports Selenium 4 and the W3C WebDriver protocol, so an existing Selenium 4 script needs few changes. 

You need your Pcloudy email and an API access key. Log in, open Quick Actions in the bottom-left corner, and copy the key. Keep both out of your source code. The sample below reads them from environment variables. 

The easiest way to get the right capabilities is the Capability Configurator in your Pcloudy account. Pick the OS, OS version, browser and Selenium version, and copy the generated capabilities into your script. See [Selenium capability]

import java.net.URL; 

import java.util.HashMap; 

import org.openqa.selenium.remote.DesiredCapabilities; 

import org.openqa.selenium.remote.RemoteWebDriver; 

import org.testng.Assert; 

import org.testng.annotations.AfterClass; 

import org.testng.annotations.BeforeClass; 

import org.testng.annotations.Parameters; 

import org.testng.annotations.Test; 

public class SafariCloudTest { 

    private RemoteWebDriver driver; 

    @BeforeClass 

    @Parameters({"os", "osVersion", "browserVersion"}) 

    public void setUp(String os, String osVersion, String browserVersion) throws Exception { 

        DesiredCapabilities capabilities = new DesiredCapabilities(); 

        capabilities.setCapability("browserName", "safari"); 

        HashMap<String, Object> pcloudyOptions = new HashMap<>(); 

        pcloudyOptions.put("userName", System.getenv("PCLOUDY_USERNAME")); 

        pcloudyOptions.put("accessKey", System.getenv("PCLOUDY_API_KEY")); 

        pcloudyOptions.put("clientName", System.getenv("PCLOUDY_USERNAME")); 

        pcloudyOptions.put("os", os); 

        pcloudyOptions.put("osVersion", osVersion); 

        pcloudyOptions.put("browserVersion", browserVersion); 

        pcloudyOptions.put("local", false); 

        pcloudyOptions.put("seleniumVersion", "4.18.1"); 

        capabilities.setCapability("pcloudy:options", pcloudyOptions); 

        driver = new RemoteWebDriver( 

                new URL("https://browser.device.pcloudy.com/seleniumcloud/wd/hub"), capabilities); 

    } 

    @Test 

    public void verifyHomePageTitle() { 

        driver.get("https://www.pcloudy.com/"); 

        Assert.assertTrue(driver.getTitle().contains("Pcloudy"), 

                "Home page title does not contain the brand name"); 

    } 

    @AfterClass 

    public void tearDown() { 

        if (driver != null) { 

            driver.quit(); 

        } 

    } 

}

[QA to run this sample once against the browser cloud before publishing. Confirm the “seleniumVersion” value and the “os”, “osVersion” and “browserVersion” strings for Safari from the Capability Configurator. The Pcloudy Selenium 4 docs example uses “MAC”, “Ventura” and a Chrome version.] 

The testng.xml below runs the same test on two environments at once. thread-count is 2 and parallel is “tests”, so both start together. 

<?xml version="1.0" encoding="UTF-8"?> 

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> 

<suite name="safari-cross-browser" parallel="tests" thread-count="2"> 

  <test name="Sonoma-Safari-17"> 

    <parameter name="os" value="MAC"/> 

    <parameter name="osVersion" value="Sonoma"/> 

    <parameter name="browserVersion" value="17"/> 

    <classes><class name="SafariCloudTest"/></classes> 

  </test> 

  <test name="Ventura-Safari-16"> 

    <parameter name="os" value="MAC"/> 

    <parameter name="osVersion" value="Ventura"/> 

    <parameter name="browserVersion" value="16"/> 

    <classes><class name="SafariCloudTest"/></classes> 

  </test> 

</suite>

Each test name now matches the environment it runs on. In the live post, one test was named “Catalina-Mojave-14” but ran Safari 13. 

To watch a run, open the Pcloudy device page and go to Reports. “My Active Sessions” shows runs in progress, and “All Reports” lists past runs with their logs and screenshots.

Frequently asked questions 

Do I need to download a driver to automate Safari? 

No. safaridriver is installed with macOS. You only need to enable it once with safaridriver –enable. 

Can I run Safari tests on Windows? 

Not locally. Apple stopped supporting Safari on Windows in 2012. To run Safari tests from a Windows machine, point your Selenium script at Mac machines in a cloud grid, such as the Pcloudy browser cloud. 

How many Safari WebDriver sessions can run at the same time? 

One per Safari instance. To run tests in parallel, spread them across several Macs. A browser cloud does this for you. 

How do I debug Safari on an iPhone? 

Two ways. With your own iPhone, turn on Web Inspector in Settings, connect it to a Mac by USB, and pick the device from Safari’s Develop menu. With a real iOS device in the cloud, use the Pcloudy Safari Debugger, which shows the device screen next to the page’s DOM. 

Does Safari on iPhone have built-in developer tools? 

Yes. Safari has Web Inspector. Turn it on under Settings, Safari, Advanced on the iPhone, then connect the phone to a Mac and open the inspector from Safari’s Develop menu. 

How can I debug Safari on an iPhone without a Mac? 

Use a real iOS device in the cloud. With the Pcloudy Safari Debugger you open Safari on a real device and inspect the page from your browser. 

Is WebKit the same as Safari? 

No. WebKit is the engine. Safari is the browser built on it, with its own behaviour and settings. WebKit-based test runs are good for early coverage, but they do not replace testing in real Safari. 

How do I test a site in Safari without any setup? 

Open a session on test on safari browser. You can test on real Safari versions with no code and no Mac of your own to set up. 

Next steps 

Start with SafariDriver on your own Mac. When you need more Safari versions, parallel runs, or real iOS devices, start a free trial and run the same tests on Pcloudy. 

Related reading:

Did you find this page helpful?

Author

Jessica R Selvin

Lead - Solution Engineering

Jessica Selvin leads Solution Engineering at Pcloudy, where she works closely with customers to translate real-world testing challenges into product solutions. She started as a Presales Specialist and has spent her time at Pcloudy deep in the weeds of what actually makes mobile and web testing hard for QA teams. When she's not on customer calls, she's probably explaining a tricky automation edge case to someone on the product team.

Reviewer

Archana Gupta

Archana Gupta

Senior Lead Testing at Pcloudy

Archana Gupta leads Product Management at Pcloudy, with 8+ years at the company across QA engineering, team leadership, and product roles. Her expertise spans product strategy and quality assurance, informed by hands-on testing experience before moving into product.

Ready to find bugs before your users do?

Run your mobile test suite on 5,000+ real Android and iOS devices in the Pcloudy cloud—with parallel execution, video capture, and CI-ready workflows.

Book a Free Demo →