标签:
package com.example.tests;
import com.thoughtworks.selenium.*;
import org.junit.Before;
import org.junit.Test;
import org.junit.After;
public class selenium extends SeleneseTestCase {
@Before
public void setUp() throws Exception {
. . .
}
@Test
public void testSelenium_test() throws Exception {
. . .
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
}
|
import junit.framework.TestCase;
import org.openqa.selenium.*;
import org.junit.Before;
import org.junit.Test;
import org.junit.After;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
public class selenium extends TestCase {
WebDriver driver;
@Before
public void setUp() {
FirefoxProfile profile = new FirefoxProfile();
. . .
driver = new FirefoxDriver(profile);
}
@Test
public void testSelenium_test() throws Exception {
. . .
}
@After
public void tearDown() {
driver.quit();
}
}
|
标签:
原文地址:http://www.cnblogs.com/blongfree/p/4980834.html