最近学习selenium遇到的问题,求大神帮忙啊!
最近做关于自动化测试框架的毕业设计,公司的老师让我去自学selenium,IDE录制回放脚本搞定了,但是转移到RC上就显示该页面不存在,这到底是为什么呀?
代码我附在下面了:
package abc;
import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
import java.util.regex.Pattern;
public class Abc {
private Selenium selenium;
@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost", 4444, "*custom C:/Program Files (x86)/Internet Explorer/iexplore.exe","http://www.baidu.com");
selenium.start();
}
@Test
public void testAbc() throws Exception {
selenium.open("/index.php?tn=monline_5_dg");
selenium.type("id=kw", "abc");
selenium.click("id=su");
selenium.waitForPageToLoad("30000");
selenium.click("link=ABC News: Breaking News & Latest News - ABC News");
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
}
因为从IDE上转过来也出现了些错误,所以自己也改动了一点。希望selenium的大神能指点一下~