Проверьте ссылки с getAllLinks - PullRequest
0 голосов
/ 03 февраля 2011

Я тестирую приложение с селеном ide и rc.Мне нужно проверить ссылки.

Обычно я экспортирую файл из Selenium ide в junit 4 и запускаю файл в eclipse.Файл выглядит следующим образом

пакет com.example.tests;

import com.thoughtworks.selenium. *;импорт org.junit.After;импорт org.junit.Before;import org.junit.Test;import java.util.regex.Pattern;

расширяет открытый класс* -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 Я хотел бы проверить ссылки на странице.Пожалуйста, кто-нибудь может мне помочь ??

Спасибо

1 Ответ

2 голосов
/ 12 мая 2011

assertAllLinks(pattern) сгенерировано из 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.
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...