1

I am new to appium and started writing some basic scripts with java. I need a code which will check the device internet connectivity on which test going to perform.

This will be basic test before starting the actual test. Please help.

Thanks in advance.

  • What have you tried so far? Maybe you take [the tour first](http://stackoverflow.com/tour) and also check [how to ask a good question](http://stackoverflow.com/help/how-to-ask). – Cleb Jul 02 '15 at 08:07
  • I know the question specifically asks for an appium solution, but it may be better to try something slightly different. Would be better to leverage `adb shell dumpsys connectivity | grep NetworkInfo`? You can then inspect the connectivity to the internet (CONNECTED state). For example, you may see a line similar (may be different for different devices) to: `NetworkInfo: type: WIFI[], state: CONNECTED/CONNECTED,`... I think you can also inspect `UMTS` NetworkInfo as well if that is relevant. Go ahead and test it on your device. – Tr1gZer0 Mar 09 '17 at 23:19

1 Answers1

1

I am not sure that you can verify the device internet connectivity directly from appium. However you can prepare small apk (I assume you use the Android device) that will verify that , see details here. Or you may launch some browser (like Chrome) on the device and verify that the online page is received.

Community
  • 1
  • 1
Eugene
  • 1,791
  • 3
  • 19
  • 22