I am a beginner in Selenium WebDrive. Is there any dummy projects or testcases that could help me start learning? Could you please suggest some starting points?
Asked
Active
Viewed 597 times
2 Answers
0
You can just use a dummy class as shown below..
import static org.junit.Assert.fail;
import java.util.concurrent.TimeUnit;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class TestExample {
private WebDriver driver;
private String baseUrl;
private StringBuffer verificationErrors = new StringBuffer();
@Before
public void setUp() throws Exception {
driver = new FirefoxDriver();
baseUrl = "http://localhost:8080";
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
@Test
public void testExample() throws Exception {
driver.get(baseUrl);
}
@After
public void tearDown() throws Exception {
driver.quit();
}
}
And just make sure you have the Selenium maven repo in your pom with junit.

David
- 19,577
- 28
- 108
- 128
-
The above example is really nothing more that you would already find by just reading the Selenium documentation. – djangofan Jan 07 '14 at 17:36
-
1I think that's actually where I got it originally, but it was in my project at the time and it met OP's description. – David Jan 07 '14 at 17:37
0