Show / Hide Table of Contents

Class BrowserFactory

BrowserHelper is a tooling class helps user to get the Selenium WebDriver object from the given context : platform, browserType.

Inheritance
Object
BrowserFactory
Namespace: AxaFrance.WebEngine.Web
Assembly: AxaFrance.WebEngine.Web.dll
Syntax
public static class BrowserFactory

Methods

| Edit this page View Source

GetDriver(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
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
| Edit this page View Source

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.

IEnumerable<String> browserOptions

A List of webDriver options you want to use for Web testings.

Returns
Type Description
WebDriver

WebDriver object

Remarks

If you are using another test framework, additional information must be provided 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
| Edit this page View Source

StartMonitoring(WebDriver)

Start monitoring web traffics.

Declaration
public static ResourceUsageReport StartMonitoring(WebDriver driver)
Parameters
Type Name Description
WebDriver driver
Returns
Type Description
ResourceUsageReport
| Edit this page View Source

StopMonitoring(ResourceUsageReport)

Stop monitoring web traffics.

Declaration
public static void StopMonitoring(ResourceUsageReport report)
Parameters
Type Name Description
ResourceUsageReport report
| Edit this page View Source

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
WebDriver driver

WebDriver to use

  • Edit this page
  • View Source
In this article
Back to top Copyright ® 2016-2024 AXA France, All rights reserved.