Is there a good way to script network tests using UIAutomation on iOS

I am looking for a way to test some network connection scenarios using UIAutomation (for example, make sure that the correct messages are displayed to the user for different connection scenarios). Can anyone find a way to disable the network on an iOS device (for example, turn on airplane mode) using scripts?

Thanks,

+4
source share
2 answers

I ran into the same problem. After a long cleaning of the Internet, I came to the conclusion that this cannot be done using the UIAutomation class. You need to either do this manually, or use a different method, for example, write an objective-c code fragment that programmatically disables wifi / network or uses some other automation tool to write a script that turns on / off the network. Then you can run / call the script / code from the tools using the performTaskWithPathArgumentsTimeout function. Although I could not realize it myself. If anyone has a better solution, please share!

0
source

in fact, you could connect to the host’s wireless network and disconnect it through the command line, but I have not verified it yet.

0
source

Source: https://habr.com/ru/post/1391356/


All Articles