Features

C# Automated App Testing

See our C# App example repository for a simple example on how to run C# tests on Mobile Devices with TestingBot.

This guide will help you run mobile automated tests with Appium and C# on the TestingBot device cloud.

Getting Started

Please download the appium-dotnet-driver and add it to your project.

Real Device Testing


This will download and install a sample Android app we built. It will add two numbers to a textinput and display the sum of the two numbers.

using System;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Android;
using OpenQA.Selenium.Remote;
using OpenQA.Selenium.Support.UI;

namespace TestingBotAppiumSingleTest
{
    class MainClass
    {
        readonly static string key = "TB_KEY";
        readonly static string secret = "TB_SECRET";

        public static void Main(string[] args)
        {
            DesiredCapabilities caps = new DesiredCapabilities();
            caps.SetCapability("key", MainClass.key);
            caps.SetCapability("secret", MainClass.secret);
            caps.SetCapability("deviceName", "Galaxy S10");
            caps.SetCapability("version", "9.0");
            caps.SetCapability("realDevice", true);
            caps.SetCapability("app", "https://testingbot.com/appium/sample.apk");

            var driver = new AndroidDriver<AndroidElement>(new Uri("https://hub.testingbot.com/wd/hub"), caps, TimeSpan.FromSeconds(120));
            AndroidElement inputA = (AndroidElement)new WebDriverWait(driver, TimeSpan.FromSeconds(30)).Until(
                ExpectedConditions.ElementToBeClickable(MobileBy.AccessibilityId("inputA"))
            );
            inputA.SendKeys("10");
            AndroidElement inputB = (AndroidElement)new WebDriverWait(driver, TimeSpan.FromSeconds(30)).Until(
                ExpectedConditions.ElementToBeClickable(MobileBy.AccessibilityId("inputB"))
            );
            inputB.SendKeys("5");
            System.Threading.Thread.Sleep(2000);

            driver.Quit();
        }
    }
}

This will download and install a sample iOS app we built. It will add two numbers to a textinput and display the sum of the two numbers.

using System;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.iOS;
using OpenQA.Selenium.Remote;
using OpenQA.Selenium.Support.UI;

namespace TestingBotAppiumSingleTest
{
    class MainClass
    {
        readonly static string key = "TB_KEY";
        readonly static string secret = "TB_SECRET";

        public static void Main(string[] args)
        {
            DesiredCapabilities caps = new DesiredCapabilities();
            caps.SetCapability("key", MainClass.key);
            caps.SetCapability("secret", MainClass.secret);
            caps.SetCapability("deviceName", "iPhone 8");
            caps.SetCapability("version", "13.4");
            caps.SetCapability("realDevice", true);
            caps.SetCapability("app", "https://testingbot.com/appium/sample.ipa");

            IOSDriver<IOSElement> driver = new IOSDriver<IOSElement> (new Uri("http://hub.testingbot.com/wd/hub"), caps, TimeSpan.FromSeconds(300));

            IOSElement inputA = (IOSElement) new WebDriverWait(driver, TimeSpan.FromSeconds(30)).Until(
                ExpectedConditions.ElementToBeClickable(MobileBy.AccessibilityId("inputA"))
            );
            inputA.SendKeys("10");
            IOSElement inputB = (IOSElement)new WebDriverWait(driver, TimeSpan.FromSeconds(30)).Until(
                ExpectedConditions.ElementToBeClickable(MobileBy.AccessibilityId("inputB"))
            );
            inputB.SendKeys("5");

            IOSElement sum = (IOSElement)new WebDriverWait(driver, TimeSpan.FromSeconds(30)).Until(
                ExpectedConditions.ElementToBeClickable(MobileBy.AccessibilityId("sum"))
            );

            Console.WriteLine(sum);
            driver.Quit();
        }
    }
}

Simulator/Emulator Testing


This will download and install a sample Android app we built. It will add two numbers to a textinput and display the sum of the two numbers.

using System;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Android;
using OpenQA.Selenium.Remote;
using OpenQA.Selenium.Support.UI;

namespace TestingBotAppiumSingleTest
{
    class MainClass
    {
        readonly static string key = "TB_KEY";
        readonly static string secret = "TB_SECRET";

        public static void Main(string[] args)
        {
            DesiredCapabilities caps = new DesiredCapabilities();
            caps.SetCapability("key", MainClass.key);
            caps.SetCapability("secret", MainClass.secret);
            caps.SetCapability("deviceName", "Galaxy S9");
            caps.SetCapability("version", "9.0");
            caps.SetCapability("app", "https://testingbot.com/appium/sample.apk");

            var driver = new AndroidDriver<AndroidElement>(new Uri("https://hub.testingbot.com/wd/hub"), caps, TimeSpan.FromSeconds(120));
            AndroidElement inputA = (AndroidElement)new WebDriverWait(driver, TimeSpan.FromSeconds(30)).Until(
                ExpectedConditions.ElementToBeClickable(MobileBy.AccessibilityId("inputA"))
            );
            inputA.SendKeys("10");
            AndroidElement inputB = (AndroidElement)new WebDriverWait(driver, TimeSpan.FromSeconds(30)).Until(
                ExpectedConditions.ElementToBeClickable(MobileBy.AccessibilityId("inputB"))
            );
            inputB.SendKeys("5");
            System.Threading.Thread.Sleep(2000);

            driver.Quit();
        }
    }
}

This will download and install a sample iOS app we built. It will add two numbers to a textinput and display the sum of the two numbers.

using System;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.iOS;
using OpenQA.Selenium.Remote;
using OpenQA.Selenium.Support.UI;

namespace TestingBotAppiumSingleTest
{
    class MainClass
    {
        readonly static string key = "TB_KEY";
        readonly static string secret = "TB_SECRET";

        public static void Main(string[] args)
        {
            DesiredCapabilities caps = new DesiredCapabilities();
            caps.SetCapability("key", MainClass.key);
            caps.SetCapability("secret", MainClass.secret);
            caps.SetCapability("deviceName", "iPhone 8");
            caps.SetCapability("version", "13.4");
            caps.SetCapability("app", "https://testingbot.com/appium/sample.zip");

            IOSDriver<IOSElement> driver = new IOSDriver<IOSElement> (new Uri("http://hub.testingbot.com/wd/hub"), caps, TimeSpan.FromSeconds(300));

            IOSElement inputA = (IOSElement) new WebDriverWait(driver, TimeSpan.FromSeconds(30)).Until(
                ExpectedConditions.ElementToBeClickable(MobileBy.AccessibilityId("inputA"))
            );
            inputA.SendKeys("10");
            IOSElement inputB = (IOSElement)new WebDriverWait(driver, TimeSpan.FromSeconds(30)).Until(
                ExpectedConditions.ElementToBeClickable(MobileBy.AccessibilityId("inputB"))
            );
            inputB.SendKeys("5");

            IOSElement sum = (IOSElement)new WebDriverWait(driver, TimeSpan.FromSeconds(30)).Until(
                ExpectedConditions.ElementToBeClickable(MobileBy.AccessibilityId("sum"))
            );

            Console.WriteLine(sum);
            driver.Quit();
        }
    }
}

Preparing Your App

Please see our Prepare Mobile App documentation to make sure your app will work on our emulators/devices.

Uploading Your App

Please see our Upload Mobile App documentation to find out how to upload your app to TestingBot for testing.

Configuring Capabilities

To run your existing tests on TestingBot, your tests will need to be configured to use the TestingBot remote machines. If the test was running on your local machine or network, you can simply change your existing test like this:


Before
IOSDriver<IOSElement> driver = new IOSDriver<IOSElement> (new Uri("http://localhost:4444/wd/hub"), caps, TimeSpan.FromSeconds(300));

After
IOSDriver<IOSElement> driver = new IOSDriver<IOSElement> (new Uri("http://hub.testingbot.com/wd/hub"), caps, TimeSpan.FromSeconds(300));


Specifying the operating system, browser and version



To let TestingBot know on which browser/platform you want to run your test on, you need to specify the browsername, version, OS and other optional options in the capabilities field.


To see how to do this, please select a combination of browser, version and platform in the drop-down menus below.


1. Select an OS
2. Select a device


Parallel Testing

Parallel Testing means running the same test, or multiple tests, simultaneously. This greatly reduces your total testing time.

You can run the same tests on all different browser configurations or run different tests all on the same browser configuration.
TestingBot has a large grid of machines and browsers, which means you can use our service to do efficient parallel testing. It is one of the key features we provide to greatly cut down on your total testing time.


Queueing

Every plan we provide comes with a limit of concurrent VMs (how many tests you can run in parallel).
For example: if you have a plan with 5 concurrent VMs, it is possible to start more tests. TestingBot will queue the additional tests and run the tests as soon as slots become available.

Other Options

We offer many other test options, for example: disable video recording, specifying a custom Firefox Profile, loading Chrome/Firefox/Safari extensions, running an executable before your test starts, uploading files, ...
See our list of test options for a full list of options to customize your tests.