Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to run Appium tests on Android devices over Wi-Fi?

I just had release cycle completed and had to run sanity pack for mobile as well as a desktop application.  That day, unfortunately, I missed the cable at home because I was doing deployment till late at night. In such a case, I had to figure out some way so that I could run our Appium Tests for Sanity run. Thus, I thought to connect our Android Devices over Wi-Fi. It was just a little instance when I started Appium tests over Wi-Fi. Your case could be different, such as, when you want to run mobile tests over different devices and you don’t have the cable so in such case you can distribute few with cable and few over Wi-Fi.

Does it make sense?

Yes.

The agenda of this article is to teach you how to run Appium test cases on Android devices over Wi-Fi. Before that, I would recommend you some fundamental articles on Appium. So let’s have a look at them:

  • Installing the app with ADB commands in Android devices
  • Auto start Appium server with Java Programming
  • Find Mobile Elements using UiAutomatorViewer Tool
  • Configure Android SDK and Install Appium

For more Appium Tutorials, Click here.

Step by Step guide to connect Android Devices over Wi-Fi to run Appium Tests

Follow the steps below to connect your Android devices over Wi-Fi.

Step# 1: Check connected devices

Command: adb devices

Use the above command to check how many devices are connected with your machine.

Step# 2: Validate Wi-Fi Connection

You should make sure that your Android devices and machine are both on the same Wi-Fi network.

Step# 3: Start TCPIP and restart ADB daemon

Command: adb tcpip

This command turns off default device identification by USB and it starts identifying them through TCPIP protocol.

Step# 4: Get the IP Address of your Device

First, you need to get the IP address of your device. Devices are connected over Wi-Fi by using the IP address only. You can get it from ‘About Phone’ options inside Settings of your device.

See Image below:

Step# 5: Connect Android devices Over Wi-Fi

Command: adb connect

Use the above command to connect your devices over Wi-Fi.

How to connect multiple Android devices over Wi-Fi to execute Appium tests?

Above steps connect a single device over Wi-Fi. If you want to connect multiple devices then you have to first connect each device through USB cable. Then remove the cable and follow the above steps for each of the devices. By doing so, you can connect multiple Android devices over Wi-Fi.

How to set back port from TCPIP to USB?

After you finish running your Appium tests over Wi-Fi then it should be your duty to set back the port to USB.  Use the following command to gain back the USB port connectivity for the Android devices.

Command: adb usb

This was all about connecting android devices over Wi-Fi and triggering your Appium tests in the same wireless network. You can post your queries by using below comment form and also do not forget to follow us on Social media.

The post How to run Appium tests on Android devices over Wi-Fi? appeared first on Inviul.



This post first appeared on Inviul, please read the originial post: here

Share the post

How to run Appium tests on Android devices over Wi-Fi?

×

Subscribe to Inviul

Get updates delivered right to your inbox!

Thank you for your subscription

×