-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added practical example of how to use capabilities #1218
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2547,6 +2547,66 @@ <h3>Processing Capabilities</h3> | |
</ol> | ||
|
||
</section> <!-- /Processing Capabilities --> | ||
|
||
<aside class=example> | ||
<p>Capabilities are meant for defining a failsafe matrix selection of a | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/are meant for/can be used to/ |
||
browser configuration in a distributed WebDriver environment. When | ||
communicating directly with an endpoint node (i.e. geckodriver), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Drop “(i.e. geckodriver)” and link |
||
<a>capabilities</a> dictionaries are only used for carrying | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/only/primarily/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They could also be used by (for example) the geckodriver or the safaridriver to do something like pick a version channel to use ("canary", "release"), but I don't think that any of them actually take advantage of this possibility. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also note that even in the case of an end point node, it might be useful to configure things differently between browser versions (perhaps different versions of plugins that depend on features only exposed/removed in particular browser versions) |
||
browser-specific configuration (i.e. <var>moz:firefoxOptions</var>); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/(i.e. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please link to |
||
however, when talking to an <a>intermediary node</a> multiplexer, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. intermediary node … that acts as a multiplexer |
||
the request will likely be forwarded to another node: <a>capabilities</a> | ||
are used for selecting a node in this network that matches the capability | ||
requirements.</p> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What tends to happen is that the intermediary node expands the matrix, then iterates over the merged capabilities until it finds one that matches. The request itself is seldom sent to the node, but something semantically equivalent to one of the requested capabilities is sent. |
||
|
||
<p>If there is a requirement to have a Firefox webdriver, with no specific | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/to have a Firefox webdriver/to purvey a Firefox WebDriver session/ |
||
requirements in terms of operating system, the requirement object | ||
would be:</p> | ||
|
||
<pre>{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This example is incorrect. Provided the sent payload contains an object as the value of the |
||
"alwaysMatch": { | ||
"browserName": "firefox" | ||
} | ||
}</pre> | ||
|
||
<p>If Firefosx is still a requirement, but the operating system is also | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo |
||
to be taken into account and it must be either <code>linux</code> or | ||
<code>windows</code>, the requirement object would be: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would skip “If Firefosx is still a requirement” and instead say:
|
||
|
||
<pre>{ | ||
"alwaysMatch": { | ||
"browserName: "firefox" | ||
}, | ||
"firstMatch": [ | ||
{"platformName": "windows"}, | ||
{"platformName: "linux"} | ||
] | ||
}</pre> | ||
|
||
<p>This system allows complex matrix selections; if the requirements | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect use of semicolon. |
||
dictate that any browser picked must supports ignoring <a>insecure TLS | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/must supports/must support/ |
||
certificates</a>, but also that (1) if it’s Firefox, it must also support | ||
changing the window dimensions, (2) if it's Safari, there is no | ||
further requirements: | ||
|
||
<pre>{ | ||
"alwaysMatch": { | ||
"acceptInsecureCerts": true | ||
}, | ||
"firstMatch": [ | ||
{ "browserName": "firefox", "setWindowRect":true }, | ||
{ "browserName": "safari" } | ||
] | ||
}</pre> | ||
<p>Basically, the <a>intermediary node</a> will pick the first webdriver in | ||
the network that fits the requirements listed in a | ||
<code>firstMatch</code> entry (that is, either | ||
<code>{ "browserName": "firefox", "setWindowRect": true }</code> or | ||
<code>{ "browserName": "safari" }</code>), but <i>always</i> making sure | ||
that <code>{ "acceptInsecureCerts": true }</code> is satisfied. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would drop this entire paragraph. |
||
</p> | ||
</aside> | ||
|
||
</section> <!-- /Capabilities --> | ||
|
||
<section> | ||
|
@@ -5365,7 +5425,7 @@ <h3>Get Element CSS Value</h3> | |
is obtained from <a>url variables</a>. | ||
|
||
<dt>Otherwise | ||
<dd> "" (empty string) | ||
<dd> "" (empty string) | ||
</dl> | ||
|
||
<li>Return <a>success</a> with data <var>computed value</var>. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel that this example should go above 7.1 Proxy.