
It turns out that there is a way to close all of those tabs simultaneously, and it’s so ridiculously simple that you’ll find yourself wondering why you never knew how to do this before.Īs an example, launch Safari on your iPhone, and tap once on the tabs button (it’s circled in red in the screenshot below): (The iPhone tabs button, circled in red.) Many users find themselves tapping on the tabs button, which looks like two overlapping squares, and then scrolling through a long list of open tabs closing them one at a time by tapping the X button. Especially on the iPhone where there are no visible tabbed web sessions (in other words, you only see one tab at a time), it’s quite easy to have dozens or hundreds of tabs open at the same time. This automation code sample does not work in any Android version.One of the most common questions I get from iPhone and iPad users has to do with Apple’s Safari web browser. This automation code sample does not work in the following iOS versions

This automation code sample currently works in the following iOS Versions: Map params = new HashMap() params.clear() params.put("automation", "os") driver.executeScript("mobile:browser:open", params) ntext("NATIVE_APP") WebElement browserTab = TouchAction action = new TouchAction(driver) action.longPress(browserTab).press(browserTab) action.perform() action.longPress(browserTab).release() action.perform() params.clear() params.put("content", "Close All") params.put("timeout", "30") driver.executeScript("mobile:text:find", params) ntext("NATIVE_APP") All')]").click() Thread.sleep(10000) As a helpful step, here is a JAVA code sample using Appium, that can work for iOS 11 and newer: This can also be done through automation. This will clear the tabs for your iOS device.

Next up, you will get the option to close all the open tabs at once. (For a long touch, hold down the Ctrl key and click & hold on the desired location on the device)

Step #2. Second, tap and hold on the tab button.

Step #1. First, launch Safari on your iOS device. However, if you find yourself with too many tabs open and want to start fresh, there’s a shortcut to close all your tabs at once.īy Christopher Alton Legacy | Manual Process In iOS 10 and newer, Safari supports an unlimited number of tabs.
