title: Re-using same instance again webdriverJS
body: <p>I am really new to Selenium. I managed to open a website using the below nodejs code</p>
  
  <pre><code>var webdriver = require('selenium-webdriver');
  
  var driver = new webdriver.Builder()
      .forBrowser('chrome')
      .build();
  console.log(driver);
  
  driver.get('https://web.whatsapp.com');
  
   //perform all other operations here.
  </code></pre>
  
  <p><a href="https://web.whatsapp.com" rel="nofollow noreferrer">https://web.whatsapp.com</a> is opened and I manually scan a QR code and log in. Now I have different javascript files to perform actions like delete, clear chat inside web.whatsapp.com etc...</p>
  
  <p>Now If I get some error, I debug and when I run the script again using <code>node test.js</code>, it takes another 2 minutes to load page and do the steps I needed. I just wanted to reopen the already opened tab and continue my script instead new window opens.</p>
  
  <p>Edit day 2 : Still searching for solution. I tried below code to save object and reuse it.. Is this the correct approach ? I get a JSON parse error though.</p>
  
  <pre><code>var o = new chrome.Options();
  o.addArguments("user-data-dir=/Users/vishnu/Library/Application Support/Google/Chrome/Profile 2");
  o.addArguments("disable-infobars");
  o.addArguments("--no-first-run");
  
      var driver = new webdriver.Builder().withCapabilities(webdriver.Capabilities.chrome()).setChromeOptions(o).build();
      var savefile = fs.writeFile('data.json', JSON.stringify(util.inspect(driver)) , 'utf-8');
      var parsedJSON = require('./data.json');
      console.log(parsedJSON);
  </code></pre>