This is a skeleton test framework using Junit with instructions in Readme
- create a new maven project
- Add JUnit dependency (create first) into your POM file from https://github.com/junit-team/junit4/wiki/Download-and-Install
- Add the WebDriver dependency into the POM file from http://www.seleniumhq.org/download/maven.jsp
- Create a new package in scr>test>youPackage
- Create a new class within this package
- Add the @Test annotation to every separate test you write so JUnit will run it.
- Driver documentation on how Selenium client bindings will pick up the geckodriver binary executable. https://github.com/mozilla/geckodriver You can just add it like this: System.setProperty("webdriver.gecko.driver", "/Users/yourfolder/geckodriver");
- The test method should end with "test", eg: public static class FirstAutomationTest
- Instantiate driver object, in this case as FirefoxDriver: WebDriver driver = new FirefoxDriver();
- Test: eg, Assertion
- Close/quit driver: driver.close();
- A new test will have a different @Test annotation
- Use the @Before annotation on a method to initialise your driver
- Add the dependency. Find it here: https://mvnrepository.com/artifact/io.rest-assured/rest-assured
- Make sure you have the proper imports import static io.restassured.RestAssured.; import static org.hamcrest.Matchers.;