-
Notifications
You must be signed in to change notification settings - Fork 195
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
Please explain in simple words how firstMatch
and alwaysMatch
work
#1215
Comments
Hi @mercmobily, I've done my best to render the spec in more accessible language at https://github.com/jlipps/simple-wd-spec, maybe that will help? |
@jlipps Oh my. I spent the last 12 days battling the specs... and... I am not sure if I want to poke you for not telling me before (!), or build a statue in your honour :D If there is any vote to place a link to this document in the OFFICIAL specs... well, you'd have my vote. Now, about
I am not 100% sure what this means. But, if I understood the rest of your document and the specs right, it means I can write:
The remote end will end up considering these capability objects in order:
...is that correct? |
(FYI this WG has a policy that discussions should go on the mailing list.) Capabilities negotiation of Capabilities are meant for defining a failsafe matrix selection of a browser configuration in a distributed WebDriver environment. When you communicate directly with an endpoint node (i.e. geckodriver) capabilities dictionaries are only used for carrying browser-specific configuration (i.e. For example you might have a scenario where you need a Firefox instance but you don’t particularly care about what sort of Firefox you get: it can be any version of Firefox on any operating system:
If you did care about the operating system, and you needed it to be a Firefox on Windows or Linux:
With this system you can create more complex matrix selections, say for example you need a browser that supports ignoring insecure TLS certificate, but if it’s Firefox it must also support changing the window dimensions but you don’t care about that with Safari:
As I mentioned the capabilities object is also used for communicating configuration. If we intersperse one of the previous examples with some fictious configuration for one of the intermediary nodes (maybe it runs on Sauce) and for the browser:
I hope this helps. |
I realise this is not a "help me! help me!" forum. I have really, honestly tried to gather this information from other sources; part of the problem is the terminology change (from Selenium). I just couldn't find anything that explained this. Now... not only you explained it, but you also explained it amazingly well. would you mind me making a PR on the specs, adding this as an "Example"? I don't want this to be lost in the quiet and hard-to-search sea of closed issues... |
That is a good idea! |
There is a pull request for this #1218 |
I am sorry, this is not an issue as such, but I have read the docs probably 100 times, and I just cannot figure out how
firstMatch
andalwaysMatch
work.I see the mechanical instructions in the specs, but what is missing is a fundamental explanation of the meaning of it all. Why is it called
firstMatch
? And why isalwaysMatch
"merged"? How does the functionality check effectively work, and why?I have just finished writing a decent webdriver API which comes with full documentation, and I am having real trouble explaining what those parameters actually mean...! (And have found absolutely nothing online -- My StackOverflow question has been sitting there quietly for days)
The text was updated successfully, but these errors were encountered: