title: Example to use WebDriverJS (Selenium)
body: <p>I have started learning WebDriverJs to test websites using Javascript as scripting language from url <a href="https://code.google.com/p/selenium/wiki/WebDriverJs" rel="nofollow noreferrer">https://code.google.com/p/selenium/wiki/WebDriverJs</a> but found some understanding issue at the beginning.</p>
  <p>As per that page, I have to save chrome driver to some path. What is that path?
  How do that path link to sample below code?</p>
  <pre><code>var webdriver = require('selenium-webdriver');
  
  var driver = new webdriver.Builder().
     withCapabilities(webdriver.Capabilities.chrome()).
     build();
  
  driver.get('http://www.google.com');
  driver.findElement(webdriver.By.name('q')).sendKeys('webdriver');
  driver.findElement(webdriver.By.name('btnG')).click();
  driver.wait(function() {
   return driver.getTitle().then(function(title) {
     return title === 'webdriver - Google Search';
   });
  }, 1000);
  
  driver.quit();
  </code></pre>
  <hr />
  <p>Installing from NPM</p>
  <pre><code>% npm install selenium-webdriver
  </code></pre>
  <p>Building from Source</p>
  <pre><code> % git clone https://code.google.com/p/selenium/  
        % cd selenium   
       % ./go //javascript/node:selenium-webdriver
  </code></pre>
  <p>What is NPN and related codes? Kindly explain.</p>
  <p>P.S. : I am basically from .Net background</p>
  <p>Do I need to do any more setting to run the above code?</p>
  <p>For example, any javascript files etc</p>
  <hr />
  <p>Now I am able to install selenium-webdriver then I copied above javascript code in js file and tried to run it using node and received below error. Am I missing something?</p>
  <p><img src="https://i.stack.imgur.com/A7NGM.jpg" alt="Error while trying to run above javascript code using node" /></p>