In this section, we are going to turn the device's browser connectivity off. This means that we can check how the application works if it were offline. This is going to be a really useful feature as more and more applications try to take advantage of the move to mobile.
Let's see this in action.
BrowserConnectionand then using the method
setOnline(). If we pass in
true, it will set it online and if we set it to
false, it will set the browser offline. Following is an example:
((BrowserConnection) driver).setOnline(false); ...