Skip to content

Mozilla firefox geckodriver fix.#575

Closed
zyrukas wants to merge 2 commits intophp-webdriver:communityfrom
zyrukas:geckodriver-click-fix
Closed

Mozilla firefox geckodriver fix.#575
zyrukas wants to merge 2 commits intophp-webdriver:communityfrom
zyrukas:geckodriver-click-fix

Conversation

@zyrukas
Copy link

@zyrukas zyrukas commented May 25, 2018

I was unable to make clicks in selenium + geckodriver, until I made this change.
Mozilla firefox geckodriver fix. ([PHPUnit\Framework\Exception] Undefined index: ELEMENT).

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@zyrukas
Copy link
Author

zyrukas commented Jun 18, 2018

@OndraM Please review :)


return $this->newElement($raw_element['ELEMENT']);
return $this->newElement(
isset($raw_element['ELEMENT']) ? $raw_element['ELEMENT'] : $raw_element[\key($raw_element)]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, you can create a separate function. In order not to violate DRY

private function _getElement($raw_element) {
    return isset($raw_element['ELEMENT']) ? 
        $raw_element['ELEMENT'] : $raw_element[\key($raw_element)];
}

$elements = [];
foreach ($raw_elements as $raw_element) {
$elements[] = $this->newElement($raw_element['ELEMENT']);
$elements[] = $this->newElement(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$elements[] = $this->newElement($this->_getElement($raw_element));

@OndraM
Copy link
Collaborator

OndraM commented Sep 20, 2018

Hi @zyrukas , thanks for this, but this will fix only one particular issue - but there is much more that needs to be done in order to get everything working in latest FF & geckodriver and W3C protocol. See #469. I guess this will be replaced by #560 , am I right @dunglas ?

@OndraM OndraM closed this Sep 20, 2018
@WinstonN
Copy link

Hi Hi,

For what it's worth, I got this error using Codeception & BrowserStack using FF v62.0
Using FF v58.0 I no longer experience the error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants