Proposal for new desired capabilities used for clients to report their identities to the server
Hi Selenium devs! I've got an idea I wanted to run past you guys. What are your thoughts?
Motivation:
Several scenarios are enabled when data about WebDriver client libraries can be captured. Let's say you're the maintainer of a large Grid at a company, used by many different departments. It would be useful to know the breakdown of the client libraries your colleagues are using. As Grid maintainer and Selenium aficionado, you know when a version is released that has a bug. You can systematically eliminate use of that buggy version when you see it making connections to your Grid. You can suggest upgrades. You can suggest alternate libraries using the same language. You can discover that two teams using JavaScript are using three different client libraries, and suggest a meeting to choose one approach. More generally, it might be interesting simply to gather statistics about what languages and libraries are being used. It would also be possible, of course, for the Selenium Server itself to make use of this information and output deprecation warnings, or otherwise take into account the client's identity (not that this would be a good thing to do in general, but it might be useful in special cases).
Data structure:
I would argue that at minimum we would need two pieces of information about each client that wants to report itself:
- a unique url identifying the client (perhaps the GitHub url of the project, or the project's website)
- the version of the client
We might allow other optional bits of data:
- name of the project
- git SHA of the current revision (or this could be appended to the version for development builds)
- programming language the client utilizes
- the platform of the requestor
This suggests that a hash is the best structure for the client identity. However, in some cases we might want to allow the flexibility of reporting for multiple clients simultaneously. For example, my project Yiewd[1] is an extension to the Node WebDriver client Wd[2]. Thus it would be useful to report not only the fact that the session request is coming from Yiewd, but that it is also coming from Wd. There are probably other cases where multiple tools are used to generate the session request, and these could all be usefully tracked. So I recommend an array of hashes as the data structure.
Proposal
So ultimately I propose a new capability requestOrigins, which is an array of one or more hashes. Each hash must have the following keys: url, version, the values for both of which are strings. Optional keys are: name, language, platform, and sha, also all strings.
Example
{
browserName: "Firefox",
requestOrigins: [{
version: "0.32.5",
platform: "Mac OS X 10.9",
language: "JavaScript",
name: "Wd.js"
}, {
version: "0.3.5",
name: "Yiewd"
}]
}
How do people feel about adding this to the set of desired caps? Any feelings about the specific keys/values? I'm very open to revision on the specifics. I'd be happy to contribute time to getting the official client libraries reporting themselves using this approach.
Cheers,
Jonathan
---