So far, FluentAutomation seemeed to not support the Ipad/Android natually.
If we want to simulate with “more real” environment, we can use Appium.
But with Appium, we may need more resource. So I just want to chrome to simulate what page look in mobile devices.
With
SeleniumWebDriver.Bootstrap(
SeleniumWebDriver.Browser.Andorid // or IPad
);
It throws the NotImplementationException, so I want to use Chrome to simulate the way the web site seen in mobilee
With FluentAutomation, Wwe can easily configure the selenium driver by adding in base constructor
SeleniumWebDriver.Bootstrap(
new Uri("http://localhost:9515/"),
SeleniumWebDriver.Browser.Chrome
);
It seemed quite easy if we can access ChromeDriver/
ChromeOptions chromeCapabilities = new ChromeOptions();
chromeCapabilities.EnableMobileEmulation("Apple iPhone 6");
IWebDriver driver = new ChromeDriver(chromeCapabilities);
But FluentAutomation also provide extra constructor
constructor of bootstrap
Although the type is not obvious, but it adds dictionary to ChromeOption
var mobileEmulation = new Dictionary<string,object>();
mobileEmulation.Add("deviceName", "Google Nexus 5");// can configure different devices
var mobileOptions = new Dictionary<string,object>();
mobileOptions.Add("mobileEmulation", mobileEmulation);
var cap=new Dictionary<string,object>()
{
{ChromeOptions.Capability,mobileOptions}
};
SeleniumWebDriver.Bootstrap(
new Uri("http://localhost:9515/"),
SeleniumWebDriver.Browser.Chrome, cap
);
with the Settings, we also can configure the width and height we want.