#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.
Dependencies:
- 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"));
}
}
}
TODO: generate API Doc
- Open with Xamarin
Rebuild all
Run Unit Tests
Once, if using mono
For Nuget:
Rebuild All
withRelease
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.
For Downloads:
- Click on Packages/Linux Binaries in the left handside menu.
- Commit and push changes.