在日常的 WebUI 自动化测试脚本编写过程中,经常需要打开新的页面,或者在多个打开的页面之间进行切换,以对页面元素进行相应的操作,以模拟用户的行为,实现 UI 的自动化测试。在过往的时间中,经常有初学 Selenium(webdriver) 的朋友问及如何选择窗口的问题,其实 Selenium 已经给我们提供的了相应的方法去解决这个问题。解决思路如下:
1、通过 webdriver.getWindowHandles() 获取所有已打开窗口的信息 Set<String>
2、遍历上述信息,并切换至对应的窗口
3、通常通过 URL 或者 title 判断是否为期望的窗口,若是,则进行相应的后续操作;否,则舍弃,继续遍历(若还有未遍历的)
4、若未找到对应的窗口,则对应的自动化测试用例脚本失败,通过 TestNG 的 Assert.fail 方法报告失败原因(也可以自己定义)
通过上面的解决思路可以看出,选择窗口最常用的有两种方法(1、URL;2、title)。此文以易迅网的使用向导(购物流程、在线支付)为实例进行现实说法。
闲话少述,话归正传,小二上码。。。敬请各位小主参阅,希望能对您在日常的 WebUI 自动化脚本编写有一定的启发和帮助。若有不足或错误之处,敬请大神指正,不胜感激!
/**
* Aaron.ffp Inc.
* Copyright (c) 2004-2015 All Rights Reserved.
*/
package main.aaron.demo.window; import main.aaron.sele.core.TestCase; import org.openqa.selenium.By;
import org.testng.Assert;
import org.testng.annotations.Test;
import org.testng.annotations.AfterClass; /**
*
* @author Aaron.ffp
* @version V1.0.0: autoSeleniumDemo main.aaron.demo.window SwitchWindow.java, 2015年6月19日 下午11:20:12 Exp $
*/
public class SwitchWindow extends TestCase{
private final String baseUrl = "http://www.yixun.com/"; /**
* switch window demo 1 : by page URL
*
* @author Aaron.ffp
* @version V1.0.0: autoSeleniumDemo main.aaron.demo.window SwitchWindow.java testSwitchWindow_01, 2015年6月22日 下午12:58:32 Exp $
*
*/
@Test
public void testSwitchWindow_01(){
String url = "http://st.yixun.com/help/index.htm"; try {
this.webdriver.get(this.baseUrl); // click link text of how to shopping
this.webdriver.findElement(By.linkText("怎样购物")).click(); // refresh the page. you can annotation this, because it's not necessary when network is good
// this.webdriver.navigate().refresh(); // switch to the correct page, and return webdriver
this.webdriver = this.switchPageByUrl(url); // get actual assertion text
String shop = this.webdriver.findElement(By.cssSelector(".mod_hd")).getText(); // assert
Assert.assertEquals(shop, "购物流程"); // close window if current URL is not expected, and get expected URL
this.getUrl(url);
} catch (Exception e) {
Assert.fail(e.getMessage());
e.printStackTrace();
}
} /**
* switch window demo 1 : by page title
*
* @author Aaron.ffp
* @version V1.0.0: autoSeleniumDemo main.aaron.demo.window SwitchWindow.java testSwtichWindow_02, 2015-6-22 12:59:27 Exp $
*
*/
@Test
public void testSwtichWindow_02(){
String title = "在线支付 - 易迅网"; try {
this.webdriver.get(this.baseUrl); // click link text of how to shopping
this.webdriver.findElement(By.linkText("在线支付")).click(); // refresh the page. you can annotation this, because it's not necessary when network is good
// this.webdriver.navigate().refresh(); // switch to the correct page, and return webdriver
this.webdriver = this.switchPageByUrl(title); // get actual assertion text
String webpay = this.webdriver.findElement(By.cssSelector(".mod_hd")).getText(); // assert
Assert.assertEquals(webpay, "在线支付"); // close window if current URL is not expected, and get expected URL
this.getUrl(this.webdriver.getCurrentUrl().toString());
} catch (Exception e) {
Assert.fail(e.getMessage());
e.printStackTrace();
}
} @AfterClass
public void afterClass(){
this.webdriver.close();
this.webdriver.quit();
}
}
WebDrvier 选择窗口实例脚本演示源码(基于易迅网用户向导)
脚本运行结果如下所示:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAzwAAAGiCAIAAACtZ1SjAAAgAElEQVR4nO2d2bnkqg5GKy4HRDyOxk83hJtBBePzUB5ASAI81DbVa3390NsDg8TwW9jFa/rf/2cAAAAAeDYvRBsAAADA80G0AQAAAHQAog0AAACgAxBtAAAAAB2AaAMAAADogA5F2/Cax/dfF+IfADsDAAA8CUTbCcZhfr3mYfzrctzDc+ycM4U2s7/H+fVa/h2o1LDe2+rrynyH1/wK2dFpv1fJNzqr3LtmrWYaXtG9rzlM8uxj/f44fB+tQ4TTcuIWIhxxuNUBwO9iibZ0ShiHZBx/j3eNI/elf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lLosxyzVWQv9SynxmVxUR3QHFqdEdfqPHC4RoVbeXXaNg+Va24t8lHh+3sp1zjBc/7UeqloTKdtJKD9t8x9jCbCvbs+vf+LrVvq7/xYI9lLpWqasyxn9+2a+xVzKhMqWx1SqWsJeYzjh38s/KtGtuTYhm11e6rRGtD5VM6FXN31bhxG8cjbT3yezX6PSqfQm/DGir75Us1onP1To8e7LHMH5rFBMA8z2xjBQ/jrzWTGrrvmm/VqN/pEz706MEeywxwBjaMh0cgFhS++phQDN13x9drlLjvJ0z4r9GjB3ssM8BJEG0AAAAAHYBoAwAAAOgARBsAAABAByDaAAAAADoA0QYAAADQAYg2AAAAgA5AtAEAAAB0AKINAAAAoAMQbQAAAAAdgGgDAAAA6ABEGwAAAEAHINoAAAAAOgDRBgAAANABiDYAAACADkC0AQAAAHQAog0AAACgAxBtAAAAAB2AaAMAAADogP8AAbgrSNLHPNgAAAAASUVORK5CYII=" alt="" />
通过页面 URL 选择窗口的方法,若当前已开窗口的数量小于 2 或无匹配的窗口,则均返回最后一个窗口
/**
* Switch window by page URL. Return the last if number of windows lower than 2 or not window's URL can matched.
*
* @author Aaron.ffp
* @version V1.0.0: autoSeleniumDemo main.aaron.sele.core SeleniumCore.java switchPageByUrl, 2015-6-19 23:15:15 Exp $
*
* @param url : page URL
* @return WebDriver
*/
public WebDriver switchPageByUrl(String url){
// define variable to store current page title
String currentUrl = ""; url = "".equals(url)||(url == null) ? "":url; // get all windows
Set<String> windows = this.webdriver.getWindowHandles(); if (windows.size() < 2) {
return this.webdriver;
} try {
for (String window : windows) {
// change window
this.webdriver.switchTo().window(window); // refresh the page. you can annotation this, because it's not necessary when network is good
// this.webdriver.navigate().refresh(); Thread.sleep(3000); // get page url
currentUrl = this.webdriver.getCurrentUrl().toString(); // verify the current page is expect or not, return this if correct
if (currentUrl.startsWith(url)) {
return this.webdriver;
}
}
} catch (Exception e) {
e.printStackTrace();
} return this.webdriver;
}
通过页面 URL 选择窗口
通过页面 title 选择窗口的方法,若当前已开窗口的数量小于 2 或无匹配的窗口,则均返回最后一个窗口
/**
* Switch window by page title. Return the last if number of windows lower than 2 or not window's title can matched.
*
* @author Aaron.ffp
* @version V1.0.0: autoSeleniumDemo main.aaron.sele.core SeleniumCore.java switchPageByTitle, 2015-6-19 23:10:34 Exp $
*
* @param title : page title
*
* @return WebDriver
*/
public WebDriver switchPageByTitle(String title){
// define variable to store current page title
String currentTitle = ""; title = "".equals(title)||(title == null) ? "":title; // get all windows
Set<String> windows = this.webdriver.getWindowHandles(); if (windows.size() < 2) {
return this.webdriver;
} try {
for (String window : windows) {
// change window
this.webdriver.switchTo().window(window); Thread.sleep(3000); // get page title
currentTitle = this.webdriver.getTitle().toString(); // verify the current page is expect or not, return this if correct
if (currentTitle.equals(title)) {
return this.webdriver;
}
}
} catch (Exception e) {
e.printStackTrace();
} return this.webdriver;
}
通过页面 title 选择窗口
PS:上述用例代码中有调用 getUrl(String url) 方法,此方法的主要用途是关闭无效的网页窗口,释放系统资源,具体的方法源码敬请参阅: Selenium2学习-015-WebUI自动化实战实例-013-通过 URL 关闭多余的已开浏览器窗口
至此,WebUI 自动化功能测试脚本第 014-Selenium 窗口选择 顺利完结,希望此文能够给初学 Selenium 的您一份参考。
最后,非常感谢亲的驻足,希望此文能对亲有所帮助。热烈欢迎亲一起探讨,共同进步。非常感谢! ^_^