Search code examples
coffeescriptmocha.jswebdriver-io

Webdriver.io. Highlighting multiple elements with CTRL+click on coffescript


It is necessary to write a test for СoffeScript using Webdrivwr.io and mocha.

The test should check the selection of several elements of the table by pressing CTRL + click. Below is an example of how I tried to do. But so only one element stands out. Please can you tell me how to do it right?

  it('test', () ->
    $(selector1).click()
    browser.keys('Control')
    $(selector2).click()
    browser.keys('NULL')
  )

Solution

  • You must change the browser to run the tests in Webdriver.io (this is done in the wdio.conf.js file). If Webdriver.io is running in Firefox, then you will receive uncorrect data. If you run tests in Chrome, then this problem will disappear.