Skip to content

Undefined index: ELEMENT when using findElement() functions #688

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

Closed
otzy opened this issue Nov 26, 2019 · 1 comment
Closed

Undefined index: ELEMENT when using findElement() functions #688

otzy opened this issue Nov 26, 2019 · 1 comment

Comments

@otzy
Copy link

otzy commented Nov 26, 2019

What are you trying to achieve? (Expected behavior)

I'm trying to $driver->findElement(), findElements(), or RemoteWebElement->findElement().
All throw an exception

What do you get instead? (Actual behavior)

I get an error "Undefined index: ELEMENT" on lines that use $raw_element['ELEMENT']

var_dump($raw_element) outputs the following structure

array(1) {
  'element-6066-11e4-a52e-4f735466cecf' =>
  string(36) "1ba86d2e-0292-9242-b5b3-d90149516cef"
}

to fix this I temporary replaced all usages of $raw_element['ELEMENT'] with \array_values($raw_element)[0] and findElement() works now for me.

Details

  • Php-webdriver version: 1.7.1
  • PHP version: 7.3
  • Selenium server version: 3.141.59
  • Operating system: Mac OS X 10.14.6
  • Browser used + version: Firefox 70.0.1
@OndraM
Copy link
Collaborator

OndraM commented Nov 26, 2019

See #469 - this fix is merged to community branch and will be part of release 1.8.0.

For now you can use dev version of the branch, see #469 (comment)

@OndraM OndraM closed this as completed Nov 26, 2019
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

No branches or pull requests

2 participants