Class BrowserFactory
BrowserHelper is a tooling class helps user to get the Selenium WebDriver object from the given context : platform, browserType.
Inheritance
Namespace: AxaFrance.WebEngine.Web
Assembly: AxaFrance.WebEngine.Web.dll
Syntax
public static class BrowserFactory
Methods
| Improve this Doc View SourceGetDriver(Platform, BrowserType)
The unique function initialize the WebDriver on the target platform and browser and returns the WebDriver, AndroidDriver or IOSDriver according to contexte.
Declaration
public static WebDriver GetDriver(Platform platform, BrowserType browserType)
Parameters
Type | Name | Description |
---|---|---|
Platform | platform | Android, iOS or Windows |
BrowserType | browserType | The browserType of which the test should be executed on. |
Returns
Type | Description |
---|---|
OpenQA.Selenium.WebDriver | WebDriver object |
Remarks
If you are another test framework, you must provide additional information to Instance, especially when testing on Mobile Devices.
This method will take account Desktop browsers and Mobile Devices. If platform
is valorized to 'Android'
the WebDriver object will be type of OpenQA.Selenium.Appium.Android.AndroidDriver, allows doing specific controls on the device. If platform
is
valorized to 'iOS', the WebDriver will be typeof OpenQA.Selenium.Appium.iOS.IOSDriver. Otherwise, An ordinary OpenQA.Selenium.WebDriver us returned.
When using mobile devices: under Android the native automation framework is UiAutomator2, under IOS the native automation framework used is XCUITest
Exceptions
Type | Condition |
---|---|
System.PlatformNotSupportedException |
GetDriver(Platform, BrowserType, IEnumerable<String>)
The unique function initialize the WebDriver on the target platform and browser and returns the WebDriver, AndroidDriver or IOSDriver according to contexte.
Declaration
public static WebDriver GetDriver(Platform platform, BrowserType browserType, IEnumerable<string> browserOptions)
Parameters
Type | Name | Description |
---|---|---|
Platform | platform | Android, iOS or Windows |
BrowserType | browserType | The browserType of which the test should be executed on. |
System.Collections.Generic.IEnumerable<System.String> | browserOptions | A List of webDriver options you want to use for Web testings. |
Returns
Type | Description |
---|---|
OpenQA.Selenium.WebDriver | WebDriver object |
Remarks
If you are another test framework, you must provide additional information to Instance, especially when testing on Mobile Devices.
This method will take account Desktop browsers and Mobile Devices. If platform
is valorized to 'Android'
the WebDriver object will be type of OpenQA.Selenium.Appium.Android.AndroidDriver, allows doing specific controls on the device. If platform
is
valorized to 'iOS', the WebDriver will be typeof OpenQA.Selenium.Appium.iOS.IOSDriver. Otherwise, An ordinary OpenQA.Selenium.WebDriver us returned.
When using mobile devices: under Android the native automation framework is UiAutomator2, under IOS the native automation framework used is XCUITest
Exceptions
Type | Condition |
---|---|
System.PlatformNotSupportedException |
Sync(WebDriver)
Syncrohnize the browser and wait until the document readystate is complete
Declaration
public static void Sync(this WebDriver driver)
Parameters
Type | Name | Description |
---|---|---|
OpenQA.Selenium.WebDriver | driver | WebDriver to use |