Page History
Overview
In this tutorial, we will create a JUnit JUnit4 Test Case in Java using Selenium for browser automation.
Description
Code Block | ||
---|---|---|
| ||
package selenium_sample; import org.junit.Assert; import org.junit.Test; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; public class JTest1 { @Test public void startWebDriver(){ //WebDriver driver = new FirefoxDriver(); WebDriver driver = new ChromeDriver(); driver.navigate().to("http://seleniumsimplified.com"); Assert.assertTrue("title should start differently", driver.getTitle().startsWith("Selenium Simplified")); driver.close(); driver.quit(); } } |
...
The Execution Details of the Generic Test contains information about the Test Suite, which in this case corresponds to the Test Case class.
References
- http://www.seleniumhq.org/docs/05_selenium_rc.jsp#java
- https://github.com/eviltester/startUsingSeleniumWebDriver/blob/master/src/test/java/com/eviltester/webdriver/MyFirstChromeTest.java
...