基于 SELENIUM 的自動化測試架構(21)

發表于:2017-04-11來源:gitbook作者:凌俁Linty?點擊數: 標簽:selenium
@Test 注解進行標注 * 這樣 不用main()方法 便可直接運行測試 * * @throws InterruptedException */ @Test public void test02LogIn () throws InterruptedException { WebDriver driver = this
@Test 注解進行標注 * 這樣 不用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"; // driver.getCurrentUrl() -- 獲取當前的瀏覽器URL Assert.assertEquals(driver.getCurrentUrl(), expectedUrl); } /** * 測試切換語言 * 把系統語言切換成 English * 然后查詢 語言的按鈕 是不是變成了 English *

原文轉自:http://gitbook.cn/books/58e54b57cfcd6fa52dcef1d2/index.html

...
国产97人人超碰caoprom_尤物国产在线一区手机播放_精品国产一区二区三_色天使久久综合给合久久97