Here we are running scripts from a remote/local Appium server while the devices are connected to another system in the network.
Setup:
Start adb server in the system in which devices are connected:
Just run the below command in cmd (given adb is available in path)
adb kill-server
adb -a -P 5037 server nodaemon
Appium capabilities:
Now to run appium tests we need to add the below capability:
Try appium inspector from the remote system with below capability (edit all other fields according to your setup except remoteAdbHost,systemport and adbPort)
here remoteadbhost is the remote system which has connected devices, system port is the uiautomator2 server port which is 8021 by default and finally adbport
This will allow you to inspect the remote devices from your local system
Have you always wanted to get into mobile test automation space but was reluctant thinking you have no clue where to start?
Then here you go , a simple article outlining how to setup android emulator and find the locators for the elements using Appium desktop app and Android studio
(The Android Emulator simulates Android devices on your computer so that you can test your application on a variety of devices and Android API levels without needing to have each physical device)
Note: you might get an error at the end saying cannot open correctly follow the below step
Open Android studio:
In windows go to the installation folder and open
android studio/bin and double click studio.bat
Change the Target of your android studio
Install SDK in android studio:
click SDK manager:
Select the desired SDK android version and click apply.
This will install the SDK:
Set Environment Variables:
goto windows and type edit environment variables and this two environment variable
Add the value as the path to which SDK is installed
Also add D:\MyProjects\Appium\Sdk\platform-tools to PATH
Configure emulator (Virtual device):
Click AVD Manager
Configure the device as you want and at the end use graphics as software ( use hardware only if you have a graphic card)
Install HAXM:
Hyper-V is a virtualization feature of Windows that makes it possible to run virtualized computer systems on a physical host computer. Intel’s Hardware Accelerated Execution Manager (HAXM). HAXM is a virtualization engine for computers running Intel CPUs.
Install system image:
Click play to start the simulator and then power it own:
Note:
If you get abd not found error then goto sdk installation folder delete sdk folder , reinstall sdk by going to sdk manager and select new sdk installation path
Goto File>Profile or APK Debug (select Create a newfolder if prompted)
Now goto File > Project structure and
install jdk and select project sdk
Verify Installation:
To verify that all of Appium’s dependencies are met you can use appium-doctor. Install it with npm install -g appium-doctor, then run the appium-doctor command, supplying the --ios or --android flags to verify that all of the dependencies are set up correctly.
Check if device is find by adb driver:
ADB is a command line tool that allows users to control their Android device on their Windows PC, This is like usb driver which allows windows to detect the mobile device.
to check if the emulator is detected by the driver use below command
adb devices
Appium and Appium studio :
Appium allows to interact with mobile drivers and through that to the device or emulator
It also has inbuild inspector to inspect the elements locators