Git Product home page Git Product logo

appium-dotnet-driver's Introduction

#appium-dotnet-driver

This driver is an extension of the Selenium C# client. It has all the functionalities of the regular driver, but add Appium specific methods on top of this.

v1.2.0.5

Add GetSettings(). Add IgnoreUnimportantViews();

v1.2.0.4

Update version since mismatch between NuGet and assembly.

v1.2.0.3

Update version just for NuGet package.

v1.2.0.2

Add IsLocked method. Update Packages. Add Start Activity.

v1.2.0.1

Breaking Changes: The TouchAction/MultiAction functionalities has been rewritten according to the spec here. Please refer to doc below and sample for more information.

NuGet

NuGet Package:

Dependencies:

Note: we will NOT publish a signed version of this assembly since the dependencies we access through NuGet do not have a signed version - thus breaking the chain and causing us headaches. With that said, you are more than welcome to download the code and build a signed version yourself.

Usage

basics

  • You need to add the following namespace line: using OpenQA.Selenium.Appium;.
  • Use the AppiumDriver class to construct the driver. It works the same as the Selenium Webdriver, except that the ports are defaulted to Appium values, and the driver does not know how to start the Appium on its own.
  • To use the Appium methods on Element, you need to cast the object returned by the finder method to AppiumWebElement.
...
using OpenQA.Selenium.Remote;
using OpenQA.Selenium.Appium;

namespace AppiumDriverDemo
{
	[TestFixture ()]
	public class ProgramTest
	{
		private AppiumDriver driver;

		[TestFixtureSetUp]
		public void beforeAll(){
			DesiredCapabilities capabilities = new DesiredCapabilities();

			capabilities.SetCapability("deviceName", "iPhone Retina (4-inch 64-bit)");
			capabilities.SetCapability("platformName", "iOS");
			capabilities.SetCapability("platformVersion", "7.1");
			capabilities.SetCapability("app", "<Path to your app>");
			driver = new AppiumDriver(new Uri("http://127.0.0.1:4723/wd/hub"), capabilities);		
		}

		[TestFixtureTearDown]
		public void afterAll(){
			// shutdown
			driver.Quit();
		}
			
		[Test ()]
		public void AppiumDriverMethodsTestCase ()
		{
			// Using appium extension methods
			AppiumWebElement el = (AppiumWebElement) driver.FindElementByIosUIAutomation(".elements()");
			el.SetImmediateValue ("abc");
			Assert.False (driver.IsAppInstalled("RamdomApp"));
		}
	}

}

See samples here

TouchAction

TouchAction a1 = new TouchAction (driver);
a1
  .Press (element, 100, 100)
  .Wait (1000)
  .Release ();
a1.Perform();

MultiAction

MultiAction m = new MultiAction(driver);

TouchAction a1 = new TouchAction (driver);
a1
  .Press (element, 100, 100)
  .Wait (1000)
  .Release ();
m.Add(a1);

TouchAction a2 = new TouchAction ();
a2
  .Tap (100, 100)
  .MoveTo (element);
m.Add (a2);

m.Perform();

Dev Build+Test

  • Open with Xamarin
  • Rebuild all
  • Run tests in test/specs

Nuget Deployment (for maintainers)

To Setup Nuget

  • Download Nuget exe.
  • Setup the Api Key (see here).
  • alias NuGet='mono <Nuget Path>/NuGet.exe'

To Release a New Version

  • update the assemblyInfo.cs file for the assembly with the new version and check it in
  • pull new code
  • git tag
  • Rebuild All with Release target.
  • Edit the file: appium-dotnet-driver.nuspec. (At least bump version and change release notes.)
  • NuGet pack appium-dotnet-driver.nuspec
  • NuGet push Appium.WebDriver.<version>.nupkg
  • Commit and push changes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.