Revision 5099,
1003 bytes
checked in by luiz-fernando, 13 years ago
(diff) |
Ticket #1771 - Novas alteracoes nos metodos basicos para evitar timeouts
|
Line | |
---|
1 | package org.expressolivre.cte.pages.common; |
---|
2 | |
---|
3 | import org.openqa.selenium.By; |
---|
4 | import org.openqa.selenium.WebDriver; |
---|
5 | import org.openqa.selenium.WebElement; |
---|
6 | import org.openqa.selenium.support.FindBy; |
---|
7 | |
---|
8 | /** |
---|
9 | * @author L.F.Estivalet (Serpro) |
---|
10 | * |
---|
11 | * Created on Dec 13, 2010 at 9:30:42 AM |
---|
12 | * |
---|
13 | */ |
---|
14 | public class LoginPage extends Page { |
---|
15 | |
---|
16 | @FindBy(name = "user") |
---|
17 | private WebElement username; |
---|
18 | |
---|
19 | @FindBy(name = "passwd") |
---|
20 | private WebElement password; |
---|
21 | |
---|
22 | @FindBy(id = "mensagem") |
---|
23 | private WebElement message; |
---|
24 | |
---|
25 | /** |
---|
26 | * @param driver |
---|
27 | */ |
---|
28 | public LoginPage(WebDriver driver) { |
---|
29 | super(driver); |
---|
30 | } |
---|
31 | |
---|
32 | /** |
---|
33 | * @param username |
---|
34 | * @param password |
---|
35 | */ |
---|
36 | public void login(String username, String password) { |
---|
37 | super.waitForElement(By.name("user")); |
---|
38 | this.username.clear(); |
---|
39 | this.username.sendKeys(username); |
---|
40 | this.password.sendKeys(password); |
---|
41 | this.username.submit(); |
---|
42 | |
---|
43 | } |
---|
44 | |
---|
45 | public String getMessage() { |
---|
46 | if (super.isElementPresent(By.id("mensagem"))) { |
---|
47 | return this.message.getText(); |
---|
48 | } |
---|
49 | return null; |
---|
50 | } |
---|
51 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.