Constructor
new Config()
The main aim of Config class is to provide a configuration object that will be used when creating a new session with the webdriver
A basic (empty) session configuration object looks like this:
{
capabilities: {
alwaysMatch: {
'goog:chromeOptions': { w3c: true }
},
firstMatch: []
}
}
Note that goog:chromeOptions
is set as this option is necessary to make the
Chrome webdriver work with this API.
Configuration options are set with the methods Config#setAlwaysMatch, Config#addFirstMatch, Config#set and Config#setSpecific
- Source:
Methods
setAlwaysMatch(path, value, force)
Method to set the alwaysMatch
property in the browser's capabilities
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
path |
string |
The name of the property to set. It can be a path; if path is has a Properties
|
||||||||||||||||||||||||||||||
value |
* |
The value to assign to the property |
||||||||||||||||||||||||||||||
force |
boolean |
It will overwrite keys if already present. |
- Source:
Example
this.setAlwaysMatch('platformName', 'linux')
this.setAlwaysMatch('timeouts.implicit', 10000)
addFirstMatch(key, value, force)
Adds a property to the firstMatch
array in the browser's capabilities.
Parameters:
Name | Type | Description |
---|---|---|
key |
string |
The name of the property to set |
value |
* |
The value to assign |
force |
boolean |
It will overwrite keys if needed |
- Source:
Example
this.addFirstMatch({browserName: 'chrome'})
this.addFirstMatch({browserName: 'firefox'})
NOTE: WAS:
this.addFirstMatch({'browserName', 'chrome')
this.addFirstMatch('browserName', 'firefox')
set(path, value, force)
Sets a key (or a path) on the object which will be sent to the webdriver when creating a session
Parameters:
Name | Type | Default | Description |
---|---|---|---|
path |
string |
The name of the property to set. It can be a path; if path is has a |
|
value |
* |
The value to assign |
|
force |
boolean | true |
It will overwrite keys if needed |
- Source:
setSpecific(name, path, value, force)
Sets a configuration option for the specific browser.
Parameters:
Name | Type | Description |
---|---|---|
name |
browserName |
The name of the browser to set. It can be
|
path |
string |
The name of the property to set. It can be a path; if path is has a |
value |
* |
The value to assign |
force |
boolean |
It will overwrite keys if needed |
- Source:
getSessionParameters() → {Object}
Return the current session parameters. This is used by the Driver#newSession call to get the parameters to be sent over
- Source: