title: screenshots in BDD cucumber framework in selenium
body: <p>Currently, I am using below code to take screenshot of particular action(calling in method where screenshot is important) performed. But I need to take screenshot of every page as we use to do while functional testing (before- as page loads and after- values are entered on that page) and it should name screenshot as <code>@before- PageName</code> and <code>@after-PageName</code>
  If anybody know how to take screenshot of whole Page, please let me know.</p>
  
  <pre><code>public void getscreenshot(WebDriver driver) throws Exception {
  
          File scr = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
  
          File dest = new File(("user.dir")+"screenshot" + timestamp() + ".png");
          FileUtils.copyFile(scr, dest);
          Thread.sleep(3000);
      }
  </code></pre>