title: How to properly configure Implicit / Explicit Waits and pageLoadTimeout through Selenium?
body: <p>I currently have the following setup, but I'm not sure that my waits (Implicit and pageLoadTimeout) are working. <strong>Is this the proper implementation?</strong> By putting it in the @Before("@setup"), does it work for every Scenario or Step Definition run? Will the driver wait accordingly, everytime I call a @Given, @When..etc?</p>
  
  <pre><code>@Before("@setup")
      public void setUp() {
  
          driver.manage().deleteAllCookies();
          driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
          driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
  
  
      }
  </code></pre>
  
  <p>Why is it necessary to assign a WebElement to the following wait ,
  what does WebElement element receive? Is this the right implementation? -</p>
  
  <pre><code> WebDriverWait wait = new WebDriverWait(driver, 30);
   WebElement element = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id(id)));
  boolean status = element.isDisplayed();
  </code></pre>