I am using Chrome, and I would like to be able to run automation tests in C# that tests while the application is offline (I am testing a mobile app with PhoneGap
), and later on get online to complete the tests. Is it possible using WebDriver
in Selenium 2
?
In Google Chrome you can set on developers tool like shown bellow:
But I don't know how to set it automatically on Selenium.
I know there is a way to check if application is online/offline by checking the
navigator.onLine
property, but I would like to "fake" it's values for testing purposes;
Selenium is only for web based applications, which means that you cannot run your automation tests when application is offline.
It just replicates the user actions / behavior. If your user can access your site being in offline mode, then selenium also can do & vice-versa.