Skip to content
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

Add method to get find element's response key name #292

Closed

Conversation

vkatsikaros
Copy link
Contributor

Workaround for #291

Command find element returns data, in the form {"key"=>"value"} where
key is a generic string "ELEMENT" and value the element id.

geckodriver (firefox's webdriver proxy) no longer use the key name
"ELEMENT", but instead the key name "element-6066-11e4-a52e-4f735466cecf"
So, the method was added to overide the value.

Command find element returns data, in the form {"key"=>"value"} where
key is a generic string "ELEMENT" and value the element id.

geckodriver (firefox's webdriver proxy) no longer use the key name
"ELEMENT", but instead the key name "element-6066-11e4-a52e-4f735466cecf"
So, the method was added to overide the value.
@gempesaw
Copy link
Collaborator

Huh, I had also run into this for another issue but I didn't realize it was a magic string - just figured it was a random UUID. But, lo and behold, the spec specifies that exact string!

That being said, thanks for the PR and reminding me that forgot to push up my commits. I definitely appreciate the effort, but I think it makes more sense for the resolution to exist in WebElement instead of only applicable to geckodriver and Selenium::Firefox. That way, if/when other browser drivers conform with the spec (and the actual selenium server standalone jar as well), we won't have to change anything else.

Cheers!

@gempesaw gempesaw closed this Oct 31, 2016
@gempesaw
Copy link
Collaborator

gempesaw commented Nov 1, 2016

blergh, on the other hand, your implementation makes some things way easier, like for example switch_to_frame's endpoint actually cares very much about us sending ELEMENT to SRD and element-6066... to geckodriver. Without the appropriate key for the appropriate driver, it blows up. Luckily, we can send both, which is kinda sloppy, but....

So it's not quite enough for WebElement to be able to consume either one, it needs to also output either/both. man, this is a bit of a headache :c

@vkatsikaros
Copy link
Contributor Author

Let me know if I can be of assistance for either implementation!

gempesaw added a commit that referenced this pull request Dec 13, 2016
        (bundled firefox driver version: 3.0.0b2)

        [NEW FEATURES]
        - #288: @vkatsikaris: Add context endpoints for Firefox

        [BUG FIXES]
        - #279, #281: @richi235: Fix errors in IDE plugin script generator
        - #291, #292, #299: Handle spec element key format
gempesaw added a commit that referenced this pull request Dec 30, 2016
        (bundled firefox driver version: 3.0.0b2)

        [NEW FEATURES]
        - #288: @vkatsikaris: Add context endpoints for Firefox

        [BUG FIXES]
        - #279, #281: @richi235: Fix errors in IDE plugin script generator
        - #291, #292, #299: Handle spec element key format
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants