How to make mobile goes offline?

Hi, I have some test scenarios that require the application/mobile to be tested under offline condition. Is there any command or keyword that I can make mobile offline? Thanks!

Hi @wayne.yong,

Please try this script to toggle wifi off:

import com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory

MobileDriverFactory.getDriver().toggleWifi()
1 Like

Hi @duyluong,

Thank you for answering, could I where to get the documentation or resources that. Thanks again.:blush:

@wayne.yong

You can get from Appium’s official document: http://appium.io/docs/en/commands/device/network/toggle-wifi/

MobileDriverFactory.getDriver() // will return the Appium driver
1 Like