new Browser()
Methods
attach(filter) → {Promise.<Web.BrowserTO>}
Web.BrowserFilter is used only when attaching to the browser so transient properties like Web.BrowserFilter.url and Web.BrowserFilter.title can be used.
OpenText Functional Testing for Developers recognizes browser windows and tabs that it opens (for example, via Web.Browser.launch). If a browser is opened outside of the OpenText Functional Testing for Developers context, you need to use the Web.Browser.attach method to acquire the browser tab or window. For example:
- A browser tab was opened manually while setting up a scenario prior to running a test.
- A test step clicks a link in the AUT that opens a new or replacement browser tab or window.
Parameters:
Name | Type | Description |
---|---|---|
filter | Web.BrowserFilter | The browser filter object, or property bag which contains the browser filter properties. Example: Web.Browser.attach({type: "Chrome"}).then(function (b) { browser = b; ... }); |
Returns:
- Type
- Promise.<Web.BrowserTO>
launch(browserType) → {Promise.<Web.BrowserTO>}
Parameters:
Name | Type | Description |
---|---|---|
browserType | string | The type of browser to launch: Possible values: Web.BrowserType |
Returns:
- Type
- Promise.<Web.BrowserTO>
launchDevice(browserType, device) → {Promise.<Web.BrowserTO>}
Parameters:
Name | Type | Description |
---|---|---|
browserType | string | The type of browser to launch: Possible values: Web.BrowserType. Note: not all devices support all browser types. |
device | DeviceTO | the device to launch the browser on. |
Returns:
- Type
- Promise.<Web.BrowserTO>
launchEmulated(browserType, emulatedDeviceopt) → {Promise.<Web.BrowserTO>}
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
browserType | string | The type of browser to launch: Possible values: Web.BrowserType | |||||||||||||||||||||||||||||||||||||||||
emulatedDevice | Object | string |
<optional> | The emulated device object (see members below) or the name of predefined emulated device as it appears in Chrome e.g. "iPhone 6" or "Nexus 6P" Note: the predefined devices are "Galaxy S5","Nexus 5X","Nexus 6P","iPhone 5","iPhone 6","iPhone 6 Plus","iPad". Properties
|
Returns:
- Type
- Promise.<Web.BrowserTO>
openedBrowsers(filter) → {Promise.<Array.<Web.BrowserTO>>}
Web.BrowserFilter is used only when attaching to the browser so transient properties like Web.BrowserFilter.url and Web.BrowserFilter.title can be used.
OpenText Functional Testing for Developers recognizes browser windows and tabs that it opens (for example, via Web.Browser.launch). If a browser is opened outside of the OpenText Functional Testing for Developers context, you need to use the Web.Browser.attach method to acquire the browser tab or window.
For example:
- A browser tab was opened manually while setting up a scenario prior to running a test.
- A test step clicks a link in the AUT that opens a new or replacement browser tab or window.
Parameters:
Name | Type | Description |
---|---|---|
filter | Web.BrowserFilter | The browser filter object, or property bag which contains the browser filter properties. Example: Web.Browser.openedBrowsers({type: "Chrome"}).then(function (blist) { list = blist; ... }); |
Returns:
- Type
- Promise.<Array.<Web.BrowserTO>>