Mobile App Europe 2014 Notes

Workshop Selenium, Selendroid and ios-driver Mobile and Web Automation Using One API and One Infrastructure

Notes on a workshop by Michael Palotas (Gridfusion, eBay) at the Mobile App Europe 2014.


##Webdriver Protocol

nuget Package for .NET:

install-package Selenium.WebDriver
install-package Selenium.WebDriver.ChromeDriver
install-package Selenium.WebDriver.IEDriver

Example:

[TestMethod]
public void BrowsingWithLocalDriver()
{
    using (var driver = new FirefoxDriver())
    {
        driver.Url = "http://paulroho.com";
        driver.Title.Should().Contain("PaulRoho.com");
    }
}

##Remote web driver

install-package Selenium.RC

##Selenium Grid

-

  1. Download the Selenium server from Selenium Download Page.
  2. Startup the hub

    java -jar selenium-server-standalone-2.41.0.jar -role hub

http://localhost:4444/grid/console

java -jar selenium-server-standalone-2.41.0.jar -role wd -hub http://localhost:4444/grid/register

Now the grid can be targeted by using the RemoteWebDriver:

[TestMethod]
public void BrowsingUsingSeleniumGrid()
{
    var capability = DesiredCapabilities.Firefox();
    using (var driver = new RemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), capability))
    {
        driver.Url = "http://paulroho.com";
        driver.Title.Should().Contain("PaulRoho.com");
    }
}

##Reporting

reporter.log("This is additional info");

##Mobile Automation Requirements

##Setup for selendroid:

DesiredCapabilitis.android()
capability.setCapability(SelendroidCapabilities.EMULATOR,true);
...

Possible to define the desired locale in the capabilities

Possible to inspect the native app’s Dom.


Filed under Mobile App Europe 2014 | Mobile Apps | Selenium | WebDriver | Testing