How configure Selenium test to autenticate and proceed test?
I'm using Selenium and JUnit(in Eclipse) to develop a test. In Selenium
and browser(Firefox) the test is OK, but when I export and try in Ecplipse
no work because need make login. I see some examples, but nothing similar.
@Before
public void setUp() throws Exception {
driver = new FirefoxDriver();
baseUrl = "http://...";
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
@Test
public void testEcsf() throws Exception {
driver.get(baseUrl + "/...");
driver.findElement(By.cssSelector("font")).click();
driver.findElement(By.xpath("//tr[28]/td[2]/a/font")).click();
driver.findElement(By.xpath("//table[2]/tbody/tr[3]/td/a/font")).click();
driver.findElement(By.xpath("//table[2]/tbody/tr[4]/td/a/font")).click();
driver.findElement(By.xpath("//tr[5]/td/a/font")).click();
new
Select(driver.findElement(By.id("form:_idJsp11:_idJsp28"))).selectByVisibleText("MAR/2013");
new
Select(driver.findElement(By.id("form:_idJsp11:_idJsp32"))).selectByVisibleText("MAR/2013");
driver.findElement(By.id("btnPesquisar")).click();
}
Someone know how I insert in object FirefoxDriver the login of user, or I
need change? I'm trying make a minimal change in code, if possible.
Thanks for help.
No comments:
Post a Comment