Reputation: 1
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
Upvotes: 0
Views: 847
Reputation: 31
assertAllLinks(pattern)
generated from getAllLinks()
Returns:
the IDs of all links on the page
Returns the IDs of all links on the page.
If a given link has no ID, it will appear as "" in this array.
Upvotes: 2