title: Eclipse - Can't see assert outcome in console
body: <p>My Java is quite basic and I am very new to Selenium and I'm testing to see how it works. For some reason in my code, I can see the "assert" outcome in the console, whilst in another part I cannot. I've logged messages to the console before and after the assertation (both of which show) but the assertation result does not.</p>
  
  <pre><code>package automationFramework;
  
  import org.openqa.selenium.By;
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.WebElement;
  import org.openqa.selenium.firefox.FirefoxDriver;
  import org.openqa.selenium.support.ui.ExpectedConditions;
  import org.openqa.selenium.support.ui.WebDriverWait;
  import static org.junit.Assert.*;
  
  public class Weather {
  
  public static void main(String[] args) throws InterruptedException {
  
      System.setProperty("webdriver.gecko.driver", "//home//aaronh//Documents//Drivers//geckodriver");
      // System.setProperty("webdriver.gecko.driver",
      // "//home//aaron//JARs//geckodriver-v0.14.0-linux64//geckodriver");
      WebDriver driver = new FirefoxDriver();
  
      // launch browser and go to the website
      String url = "https://www.bbc.com/weather";
      driver.get(url);
      driver.manage().window().maximize();
  
      // search weather information for Bristol
      WebElement location = driver.findElement(By.name("search"));
      location.clear();
      location.sendKeys("Bristol, Bristol");
  
      // click search button
      WebElement search = driver.findElement(By.name("submitBtn"));
      search.click();
  
      // this assertion fails because it checks the title before the search and IS LOGGED TO THE CONSOLE
      // for
      // Bristol weather has finished
  
      // String bristol = driver.getTitle();
      // assertEquals("BBC Weather - Bristol", bristol);
      System.out.println("before wait");
      WebDriverWait wait = new WebDriverWait(driver, 5);
      if (wait.until(ExpectedConditions.titleContains("BBC Weather - Bristol"))) {
          String bristol = driver.getTitle();
          System.out.println("before assert " + bristol);
  // this does not log to the console
          assertEquals("BBC Weather - Bristol", bristol);
          System.out.println("after assert");
      }
  
      driver.close();
      System.out.println("Test script executed successfully.");
      System.exit(0);
  
  }
  
  }
  </code></pre>
  
  <p>Can someone please tell me why the assertation outputs in one place and not the other? I appreciate the getTitle is pointless because the code won't get these unless the title is what we're asserting but hey, I'm just testing it out.</p>
  
  <p>Thanks.</p>