it’s been a long time 🙂
I’m still with my learning of Selenium RC and I’m using the http://www.irishtimes.com as my tested application.
I have a very tiny test case that consists of these steps:
Selenium selenium;
public void setUp() throws Exception {
super.setUp();
selenium = new DefaultSelenium("localhost",
SELENIUM_PORT,
"*firefox",
"http://www.irishtimes.com/");
setUp("http://www.irishtimes.com/", "*firefox");
}
public void testTCNewspapers() throws Exception {
selenium.start();
selenium.open("http://www.irishtimes.com/");
selenium.waitForPageToLoad("30000");
selenium.click("link=Life");
//Doesn't work
//verifyEquals("The Irish Times - Life", sel.getTitle());
}
When executing the verifyEquals I’m getting this error:
java.lang.AssertionError: java.lang.AssertionError: Expected "The Irish Times - Life" but saw "The Irish Times – Irish News, Business News, Sports News & Ireland Weather Online" instead
at com.thoughtworks.selenium.SeleneseTestBase.fail(SeleneseTestBase.java:356)
I don’t understand why this is happening since the title of the page is “The Irish Times – Life”
From the source html file:
<title>The Irish Times - Life</title>
Any help on resolving this? Thanks 😉
Selenium doesn’t wait for the new page to load after sending ‘click’.
Try using ‘clickAndWait’ – that should cause Selenium to wait for a response from the server before continuing.