Authored by Ganesh Alalasundaram
Appium is an open source cross platform automation tool for native/hybrid and mobile web based apps.
You can use Appium with various languages like c#, java or Objective C with Selenium driver. Thus it is truly a cross platform automation tool!
The machine which is running the web driver scripts communicates with the Appium server through Http/JSON and in turn Appium sends/receives the command to Devices/Emulators of Android or iOS platforms.
Here we will discuss about the Integration of Appium with Visual Studio using C#.
Setting up the Visual Studio Android Emulator.
Setting up the Appium Server
Setting up the Visual Studio Project
Create a new Unit Test project in Visual Studio.
Under Reference in Solution Explorer, Click Add Manage Nuget Packages.
Search for ‘Appium’ and install.
Post installation, the references will be updated.
In the .cs file, enter the code below. Initially we instantiate the Appium web driver and set the desired capabilities.
public class AppiumTest
public void TestBrowser()
//Set the capabilities
DesiredCapabilities cap = new DesiredCapabilities();
_driver = new AndroidDriver(new Uri("http://127.0.0.1:4723/wd/hub"), cap);
//Navigate to browser
The Test method above performs actions on the Device default browser. These actions are to:
Navigate to the http://www.bing.com website, then
Type the search text: ‘Microsoft’
Running the Test:
Most common Issues:
1. Unable to connect to remote server – no connection could be made because the target server actively refused it 127.0.0.1:4723
Resolution : Ensure the Appium server is running. And the IP address is entered correctly in the Appium server settings page. Verify the desired capabilities parameters.
2. A new connection could not be created. An unknown server side error occurred while processing the command. Unknown error. Device <IP address> is not online.
– Verify if the emulator/device is connected through adb devices -l in command prompt.
– Desired capabilities should be properly entered. Ex: devicename/platformversion/udid/platformname.
– Check for Appium settings. Restart the Appium server.
3. Could not find a connected Android device.
Ensure the android device or emulator is running. (goto command prompt, goto Android SDK\Tools\ and run adb devices -l)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.