title: Open new private window for cross browser testing using Selenium Webdriver
body: <p>In my script, I am opening private window of the browser to verify some contents in website. Below is the sample code:</p>
  
  <pre><code>if(osName.contains("Mac")){
      new Actions(tester.getInternalDriver()).keyDown(Keys.COMMAND).keyDown(Keys.SHIFT).sendKeys("P").keyUp(Keys.COMMAND).keyUp(Keys.SHIFT).build().perform();
  }
  else if (osName.contains("Win") || osName.contains("nux")){
      String pvtWin = Keys.chord(Keys.LEFT_CONTROL,Keys.SHIFT,"p");
       tester.getInternalDriver().findElement(By.cssSelector("body")).sendKeys(pvtWin);
  }
  </code></pre>
  
  <p>The code used to work fine when I was executing these test cases on my local (mac) machine or when Jenkins execute it locally on the Windows server.
  But now the challenge I am facing when I am running my script on browserstack virtual machine. My local machine is Mac, and when I try to run something on the Windows(virtual) machine, it try to look for COMMAND button on the keyboard and test case fails. Is there any better way (javascript?) to open new private window which can work on any platform and for any browser?
  I am looking for an option to open new tab, new window &amp; new private window. I know javascript has limitations to override browser behavior. </p>