package com.example.tests;
import com.thoughtworks.selenium.*;
import org.junit.*;
import java.util.regex.Pattern;
import org.openqa.selenium.server.SeleniumServer;
@SuppressWarnings("deprecation")
public class TestCase extends SeleneseTestCase {
/**
* @throws java.lang.Exception
static SeleniumServer server;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
System.out.print("setupBeforeClass\n");
server = new SeleniumServer();
server.start();
}
@AfterClass
public static void tearDownAfterClass() throws Exception {
System.out.print("tearDownAfterClass\n");
server.stop();
}
*/
@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost", 4444, "*firefox3 D:\\Firefox\\firefox.exe",
"http://www.2345.com/");
selenium.start();
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
@Test
public void testTestCase() throws Exception {
selenium.open("/?ied");
selenium.click("id=search1");
selenium.click("css=input.sbutton");
// selenium.click("link=新 闻");
// selenium.waitForPageToLoad("30000");
// selenium.click("css=font");
// selenium.click("link=民政部:20日以来强降雨致全国95人死亡45人失踪");
}
}
import com.thoughtworks.selenium.*;
import org.junit.*;
import java.util.regex.Pattern;
import org.openqa.selenium.server.SeleniumServer;
@SuppressWarnings("deprecation")
public class TestCase extends SeleneseTestCase {
/**
* @throws java.lang.Exception
static SeleniumServer server;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
System.out.print("setupBeforeClass\n");
server = new SeleniumServer();
server.start();
}
@AfterClass
public static void tearDownAfterClass() throws Exception {
System.out.print("tearDownAfterClass\n");
server.stop();
}
*/
@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost", 4444, "*firefox3 D:\\Firefox\\firefox.exe",
"http://www.2345.com/");
selenium.start();
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
@Test
public void testTestCase() throws Exception {
selenium.open("/?ied");
selenium.click("id=search1");
selenium.click("css=input.sbutton");
// selenium.click("link=新 闻");
// selenium.waitForPageToLoad("30000");
// selenium.click("css=font");
// selenium.click("link=民政部:20日以来强降雨致全国95人死亡45人失踪");
}
}