Coder Social home page Coder Social logo

dotnet-client's Introduction

appium-dotnet-client

Nuget (with prereleases) Build and deploy NuGet package NuGet Downloads

Build Status

Help Wanted

License

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.

v5 Release Candidate

Appium server compatibility for v5.x

Important

In case you are using the latest beta client v5.x please be aware you will either have to upgrade your appium server to 2.x or add the base-path argument: appium --base-path=/wd/hub, due to a breaking change on the default server base path.
Regardless, moving to appium 2.x is highly recommended since appium 1.x is no longer maintained.
For more details about how to migrate to 2.x, see the following link : appium 2.x migrating

Deprecated Methods

Caution

  • MultiAction and TouchAction are deprecated. Please use W3C WebDriver actions or mobile: extensions.
  • LaunchApp, CloseApp, and reset are deprecated, please read each deprecation message as an alternative method.
  • The ReplaceValue method is deprecated and will be removed in future versions. Please use the following command extensions: 'mobile: replaceElementValue' instead.
  • The SetImmediateValue method is deprecated and will be removed in future versions. Please use 'SendKeys' instead.

Additional Information

W3C Actions: https://www.selenium.dev/documentation/webdriver/actions_api
App management: Please read issue #15807 for more details

Migration Guide to W3C actions

  using OpenQA.Selenium.Interactions;
  
  var touch = new PointerInputDevice(PointerKind.Touch, "finger");
  var sequence = new ActionSequence(touch);
  var move = touch.CreatePointerMove(elementToTouch, elementToTouch.Location.X, elementToTouch.Location.Y,TimeSpan.FromSeconds(1));
  var actionPress = touch.CreatePointerDown(MouseButton.Touch);
  var pause = touch.CreatePause(TimeSpan.FromMilliseconds(250));
  var actionRelease = touch.CreatePointerUp(MouseButton.Touch);
 
  sequence.AddAction(move);
  sequence.AddAction(actionPress);
  sequence.AddAction(pause);
  sequence.AddAction(actionRelease);
  
  var actions_seq = new List<ActionSequence>
  {
      sequence
  };
 
  _driver.PerformActions(actions_seq);

WinAppDriver Notice!

Warning

Because WinAppDriver has been abandoned by MS, running Appium dotnet-client 5.x with WAD will not work since it has not been updated to support the W3C protocol.
To run appium on Windows Applications, you will need to use appium-windows-driver which will act as a proxy to WAD. Examples of running Windows Applications with dotnet-client can be found here: windows Integration test 5.0.0
Regardless, feel free to open an issue on the WAD repository that will help get MS to open-source that project.

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/subclass 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 independently.
  • To use the Appium methods on Element, you need to specify the parameter of AppiumDriver or its subclasses.

Read Wiki

See samples here

Dev Build+Test

Xamarin/Mono

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

JetBrains Rider

  • Open with Rider
  • From the menu Build -> Rebuild Solution
  • Run tests in Appium.Net.Integration.Tests

Visual Studio

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 assemblyInfo.cs, RELEASE_NOTES.md, and appium-dotnet-driver.nuspec with the new version number and release details, then check it in
  • pull new code
  • Rebuild All with Release target.
  • NuGet pack appium-dotnet-driver.nuspec
  • NuGet push Appium.WebDriver.<version>.nupkg

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.