0

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?

BenMorel
  • 34,448
  • 50
  • 182
  • 322

2 Answers2

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
  • 1
    I 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

You can start with the following

Getting Started Guide

documentation

more examples

Community
  • 1
  • 1
A Paul
  • 8,113
  • 3
  • 31
  • 61