webdriver
webdriver copied to clipboard
Add a capability for returning the main PID of the browser
Closes https://github.com/w3c/webdriver/issues/1823
As discussed in the issue, returning the main PID of the browser will allow us to do accessibility testing of platform accessibility APIs exposed by the browser. Otherwise, we have to rely on the browser name, which is less reliable.
This value obviously cannot be used for matching and only is an returned value.
It doesn't look like there is precedent for this, but I wonder if this should be optional capability, in case there is a reason to no return the PID?
@whimboo and @gsnedders -- can you review this change based on our discussion? :)
This PR is currently only affecting the non-normative parts of the spec. To actually return a value in capabilities you need to set it in the matching capabilities algorithm.
Ah thanks @jgraham for pointing this out. I was wondering myself about that, but I looked at the previous capability added (https://github.com/w3c/webdriver/pull/1790) and it also didn't update the matching algorithm. I wonder what the point of this previous PR was? Did it also make a mistake?
I also have a question -- and sorry if it's a silly one, I've only used webdriver minimally -- it seems to me, according to matching capabilities step 4 and later, the returned capabilities seems to only include keys that were specifically set in the new session command? Is that true?
I'm pretty sure that returning the PID should be optionally, and isn't not need and shouldn't be returned in all cases. So I'm trying to wrap my head around how to "optionally" return the PID. The other option is to use a extension capabilities to do this, like firefox does, returning "moz:processID".
Ah thanks @jgraham for pointing this out. I was wondering myself about that, but I looked at the previous capability added (https://github.com/w3c/webdriver/pull/1790) and it also didn't update the matching algorithm. I wonder what the point of this previous PR was? Did it also make a mistake?
The addition at lines 2011–3 does that, as that is within the matching algorithm.
#1792 is related here (don't expect you to solve this, just want the cross-reference!).