【发布时间】:2011-06-20 18:57:07
【问题描述】:
我正在使用 selenium ide 和 rc 测试应用程序。我需要验证链接。
通常我将文件从 Selenium ide 导出到 junit 4,然后在 eclipse 中运行文件。文件如下
包 com.example.tests;
导入 com.thoughtworks.selenium.*; 导入 org.junit.After; 导入 org.junit.Before; 导入 org.junit.Test; 导入 java.util.regex.Pattern;
公共类 login_csupport 扩展 SeleneseTestCase { @前 公共无效设置()抛出异常{ selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://daisy-w2003.hi.inet/CustomerSupport"); selenium.start(); }
@Test
public void testLogin_csupport() throws Exception {
selenium.open("http://daisy-w2003.hi.inet/CustomerSupport/?ReturnUrl=%2fCustomerSupport%2fAccount");
assertEquals("Calling Cards Customer Support - Inicio", selenium.getTitle());
selenium.type("UserName", "admin");
selenium.type("Password", "admin");
selenium.click("//div[@id='content']/div/form/div[3]/a/span[2]");
selenium.waitForPageToLoad("30000");
assertEquals("Calling Cards Customer Support - Gestión", selenium.getTitle());
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
} 使用 getAllLinks 我想检查页面的链接。拜托,谁能帮帮我??
谢谢
【问题讨论】: