Basic Java JUnit Test Setup

Here is a sample WebDriver Java test using the JUnit framework: [code] package WebDriverTest1; import static org.junit.Assert.*; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; public class WebDriverTest1 { private WebDriver driver; @Before public void setup() throws Exception { driver = new FirefoxDriver(); } @After public void teardown() throws Exception { driver.quit(); } […]

Setting up your Mac for Java WebDriver Tests

There are a couple of setup steps required before you can run a Java JUnit WebDriver test on your Mac. As always there are a number of different ways this can be done but I will outline one that has worked well for me. I’ll just outline the steps involved first and then go through […]

Is your JUnit Assert class now deprecated?

Is your JUnit Assert class now deprecated? Well here’s how to fix it. JUnit have moved things around, and as a result the Assert class is now in a different location as and from JUnit 4.11 But fear not, rectifying this is a simple one-liner. Simply change your import statement from [code]import junit.framework.Assert; [/code] to […]