Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickytonline/e196070529670b4aba46a37c96b9ddef to your computer and use it in GitHub Desktop.
Save nickytonline/e196070529670b4aba46a37c96b9ddef to your computer and use it in GitHub Desktop.
Error when clicking a button in an iframe using Webdriver IO, Chrome 59 and Chrome Driver 2.30

From web driver IO's browser.debug() when running my test. The iframe is found and the button is found, but it errors out when you click the button. And the weird thing is, it's not for all buttons in an iframe:

> const frameId = browser.$(iframeSelector).value
> browser.frame(frameId)
{ state: 'success',
  sessionId: 'b7431c7d-a458-490b-a7c2-d733e58f3f85',
  hCode: 307243156,
  value: null,
  class: 'org.openqa.selenium.remote.Response',
  _status: 0 }
  
> const insertButton = browser.$('.btInsert')
> insertButton
{ state: 'success',
  sessionId: 'b7431c7d-a458-490b-a7c2-d733e58f3f85',
  hCode: 1731720605,
  value: { ELEMENT: '48', 'element-6066-11e4-a52e-4f735466cecf': '48' },
  class: 'org.openqa.selenium.remote.Response',
  selector: '.btInsert',
  _status: 0 }
> insertButton.click()
[10:22:11]      Saved screenshot: ERROR_chrome_2017-06-27T14-22-11.700Z.png
Error: An unknown server-side error occurred while processing the command.
    at evalmachine.<anonymous>:1:-48
    at ContextifyScript.Script.runInThisContext (vm.js:25:33)
    at Object.runInThisContext (vm.js:97:38)
    at node_modules/webdriverio/build/lib/commands/debug.js:54:43
    at elementIdClick("48") - click.js:20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment