Add Custom Appium Options

Learn how to add custom Appium options.

Example

[TestFixture]
public class CustomWebDriverCapabilitiesTests : AndroidTest
{
    public override void TestsArrange()
    {
        App.AddAdditionalCapability("locale", "fr_CA");
        App.AddAdditionalCapability("language", "fr");
        App.AddAdditionalCapability("autoWebview", "true");
        App.AddAdditionalCapability("noReset", "false");
    }

    [Test]
    public void ButtonClicked_When_CallClickMethod()
    {
        var button = App.Components.CreateByIdContaining<Button>("button");

        button.Click();
    }

    [Test]
    public void ButtonClicked_When_CallClickMethodSecond()
    {
        var button = App.Components.CreateByIdContaining<Button>("button");

        button.Click();
    }
}

Explanations

App.AddAdditionalCapability("locale", "fr_CA");
App.AddAdditionalCapability("language", "fr");
App.AddAdditionalCapability("autoWebview", "true");
App.AddAdditionalCapability("noReset", "false");

BELLATRIX hides the complexity of initialization of WebDriver/Appium and all related services. In some cases, you need to customize the set up of a Appium with using custom Appium options. Using the App service methods you can add all of these with ease. Make sure to call them in the TestsArrange which is called before the execution of the tests placed in the test class. These options are used only for the tests in this particular class. Note: You can use all of these methods no matter which attributes you use- Android, AndroidSauceLabs, AndroidBrowserStack or AndroidCrossBrowserTesting.