title: how to use JavascriptExecutor in mocha webdriverio
body: <p><a href="https://i.stack.imgur.com/IKaai.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IKaai.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/Ku1ig.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ku1ig.png" alt="enter image description here"></a>
  I use mocha, webdriverio selenium-standalone framework. I want to Click element using JavaScriptExecutor，but doesn't work.</p>
  
  <p>Can anybody help me? </p>
  
  <p>Thanks</p>
  
  <p><a href="https://i.stack.imgur.com/LkyGx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LkyGx.png" alt="enter image description here"></a></p>
  
  <pre><code>it('click icon',function(){
      browser.waitForVisible(elementselector.dockServiceButton, 2000);
      assert.ok(browser.isExisting(elementselector.dockServiceButton)); 
  
      dockServiceButtonElement=$('//div[@class="icon-dock icon-dock-service "]')
      JavaScriptExecutor ex = (JavaScriptExecutor)Driver;
      ex.ExecuteScript("arguments[0].click();", dockServiceButtonElement);
  }
  </code></pre>