How to check no network cases in iOS simulator in UI testing automation

In my iOS app, When the API calls failed due to poor network, the app will display 'No network error screen'. I have to check if this error screen is displayed correctly or not in case of poor network, in automation testing using simulator. But I couldn't find any possibility to turn off internet manually in simulator and check whether the 'No network' screen displays.

I installed 'Network Link Conditioner' in macOS and tried using it on simulator. But, in simulator settings -> developer , there is no section called "Network Link Conditioner" to handle this in simulator. So, is there any other solution to handle this network case in simulator ?

But, in simulator settings -> developer , there is no section called "Network Link Conditioner" to handle this in simulator.

Right. The simulator uses the macOS networking stack. There’s no separate NLC settings for the simulator. Rather, changing the NLC settings for the Mac will affect the simulator.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

How to check no network cases in iOS simulator in UI testing automation
 
 
Q