package utils; import java.util.regex.Pattern; import java.util.concurrent.TimeUnit; import org.junit.*; import static org.junit.Assert.*; import static org.hamcrest.CoreMatchers.*; import org.openqa.selenium.*; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.support.ui.Select; public class Login { public WebDriver driver; public String baseUrl; @Before public void setUp() throws Exception { driver = new FirefoxDriver(); baseUrl = "http://sys.it-co.ru:7077/"; driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); } @Test public void authentication() throws Exception { driver.get(baseUrl + "/DBudgeting/"); driver.findElement(By.id("ctlLogin_textBoxLogin")).clear(); driver.findElement(By.id("ctlLogin_textBoxLogin")).sendKeys("admin"); driver.findElement(By.id("ctlLogin_textBoxPassword")).clear(); driver.findElement(By.id("ctlLogin_textBoxPassword")).sendKeys("admin"); driver.findElement(By.id("ctlLogin_btnLogin")).click(); } }