package RC;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.Selenium;
/*
* 注意点:首先打开D:\Selenium\JavaS\JavaTest\selenium-remote-control-1.0.3\selenium-server-1.0.3\run.bat文件
*/
public class Browse {
private Selenium selenium;
@Before
public void setUp() throws Exception {
String url="http://www.baidu.com";
//只能用于IE浏览器、火狐和谷歌浏览器版本太高
selenium = new DefaultSelenium("localhost",4444,"*iexplore",url);
selenium.start();
}
@Test
public void testUntitled() throws Exception {
selenium.open("/");
selenium.type("id=kw", "test");
selenium.click("id=su");
// selenium.waitForPageToLoad("30000");
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
}