TA的每日心情 | 衰 2017-8-3 09:55 |
---|
签到天数: 4 天 连续签到: 1 天 [LV.2]测试排长
|
本帖最后由 合肥人真帅 于 2017-5-18 16:49 编辑
package com.example.tests;
import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class B {
private Selenium selenium;
@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost", 4444, "*firefox D:/firefox/firefox.exe", "https://www.baidu.com/");
selenium.start();
}
@Test
public void testB() throws Exception {
selenium.open("/");
selenium.click("id=kw");
selenium.click("link=学术");
selenium.waitForPageToLoad("30000");
selenium.click("//form[@id='form']/span");
selenium.type("id=kw", "测试");
selenium.click("id=lg");
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
}
代码截图如下:
运行后如下:
|
|