基于 SELENIUM 的自動(dòng)化測試架構(21)
發(fā)表于:2017-04-11來(lái)源:gitbook作者:凌俁Linty?點(diǎn)擊數:
標簽:selenium
@Test 注解進(jìn)行標注 * 這樣 不用main()方法 便可直接運行測試 * * @throws InterruptedException */ @Test public void test02LogIn () throws InterruptedException { WebDriver driver = this
@Test 注解進(jìn)行標注
* 這樣 不用main()方法 便可直接運行測試
*
*
@throws InterruptedException
*/
@Test
public void test02LogIn() throws InterruptedException {
WebDriver driver =
this.baseDriver;
driver.get(
this.baseUrl);
Thread.sleep(
2000);
driver.findElement(By.id(
"account")).sendKeys(
"admin");
driver.findElement(By.id(
"password")).sendKeys(
"123456");
driver.findElement(By.id(
"submit")).click();
Thread.sleep(
2000);
String expectedUrl =
this.baseUrl +
"sys/index.html";
Assert.assertEquals(driver.getCurrentUrl(), expectedUrl);
}
/**
* 測試切換語(yǔ)言
* 把系統語(yǔ)言切換成 English
* 然后查詢(xún) 語(yǔ)言的按鈕 是不是變成了 English
*
原文轉自:http://gitbook.cn/books/58e54b57cfcd6fa52dcef1d2/index.html