Mobile App Europe 2014 Notes
Notes on a workshop by Michael Palotas (Gridfusion, eBay) at the Mobile App Europe 2014.
##Webdriver Protocol
Server to be downloaded for each browser (except FireFox - in standard Selenium JAR)
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
-
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
No jailbreaking of device required
##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.