I am trying to login to our product site , say ,site.com, using username "user" and password "pass",using selenium . There are two problems I am facing :
Each time selenium opens the site, it asks me to confirm the security exception ( even though I ask it to store it permanently).
Once the user and password are entered, it gives me an "invalid reference to login page" error . Tomcat gives it actually.
Code is below:
package com.beginning;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.SeleneseTestCase;
@SuppressWarnings("deprecation")
public class first extends SeleneseTestCase {
@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost", 4444, "*firefox", <website name>);
selenium.start();
}
@Test
public void testJw() throws Exception {
selenium.open(<login link>);
selenium.type("name=j_username", user);
selenium.type("name=j_password", pass);
selenium.click("css=input[type=\"submit\"]");
selenium.waitForPageToLoad("30000");
//selenium.click("link=Sign out");
//selenium.waitForPageToLoad("30000");
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
}