使用 getAllLinks 检查链接
我正在使用 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 { @前 公共无效setUp()抛出异常{ selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://daisy-w2003.hi.inet/CustomerSupport"); 硒.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 我想检查页面的链接。请问,任何人都可以帮助我吗?
谢谢
I´m testing application with selenium ide and rc. I need verify the links.
Usually I export file from Selenium ide to junit 4, and run file in eclipse. File is as next
package com.example.tests;
import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.regex.Pattern;
public class login_csupport extends SeleneseTestCase {
@Before
public void setUp() throws Exception {
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();
}
}
Using getAllLinks I´d like check the links of the page. Please, anyone can to help me??
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从
getAllLinks()
生成的assertAllLinks(pattern)
assertAllLinks(pattern)
generated fromgetAllLinks()