question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Click (or other Webdriver actions) not available on returned elements

See original GitHub issue

click() (and all other webdriver methods) are not available on a returned element. Otherwise Webdriver seems to be working properly. Am I doing something wrong?

Note I’m not using APP.client.click('button') because I want to click the SECOND button. (Also, I’m having all sorts of problems getting xPath or CSS selectors to directly access the second button to work.)

const btns = await APP.client.$$('button')
console.log(JSON.stringify(Object.getOwnPropertyNames(btns[0])))
["ELEMENT","element-6066-11e4-a52e-4f735466cecf","value","selector","index"]
btns[1].click()
TypeError: btns[1].click is not a function

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:5
  • Comments:6

github_iconTop GitHub Comments

4reactions
HaNdTriXcommented, Jan 17, 2019

This is because spectron uses webdriverio < v5.0.0.

Check out the changelog for more infos: https://github.com/webdriverio/webdriverio/blob/master/CHANGELOG.md#v500-2018-12-20

2reactions
tonyanzianocommented, Jul 19, 2019

Thanks for the comment @HaNdTriX , I was banging my head against the wall figuring out why none of the APIs in the WebDriverIO docs were working with Spectron.

Maybe the Spectron docs should make a note of this and not link directly to the most up-to-date version of the WebDriverIO docs?

===

Link to v4 WebDriverIO docs if anybody was looking:

http://v4.webdriver.io/api.html

Read more comments on GitHub >

github_iconTop Results From Across the Web

Selenium - Java - Element gets click but does not action
Does it perform the action when you click manually? If it "seems" to click it in the test, it means that your test...
Read more >
Solutions to The Click Problem With Selenium & Java
Examine 7 different solutions you can use in the click problem - one of the most fundamental problems you may encounter during UI...
Read more >
How To Deal With "Element is not clickable at point” Exception ...
Solution 4: Using Actions class in Selenium​​ The exception “Element is not clickable at point” might be thrown when the element is not...
Read more >
Button element found but click() action not performed
Issue was there were more buttons with given css selector variables.So when executing selenium could not find the exact elements.
Read more >
Check Visibility of Web Elements Using Various Types ...
So let us start with a brief introduction – WebDriver has a W3C ... on the web page and a “false” value if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found