亚洲好骚综合-亚洲黄色录像-亚洲黄色网址-亚洲黄色网址大全-99久久99久久-99久久99久久精品国产

您的位置:軟件測試 > 開源軟件測試 > 開源功能測試工具 > Selenium
Selenium測試框架使用xml作為對象庫
作者:網絡轉載 發布時間:[ 2015/9/14 10:53:03 ] 推薦標簽:軟件測試工具,功能測試工具

  上次使用的excel作為Locator對象管理,由于excel處理不夠方便,有以下缺點:
  不能實現分page 加載Locator對象
  不能夠實現Locator對象重名
  文件比較大,讀寫速度沒有xml快
  所以,重新寫了使用dom4j操作xml,使用xml管理Locator對象,能夠有效解決以上問題
  首先,定義Locator文件
  <?xml version="1.0" encoding="UTF-8"?>
  <map>
  <!--locator of page map info -->
  <page pageName="com.dbyl.libarary.pageAction.HomePage">
  <!--Locator lists -->
  <locator type="ByXpath" timeOut="3" value="//div[@class='top-nav-profile']//img[@class='avatar']">profile</locator>
  </page>
  <!--locator of page map info -->
  <page pageName="com.dbyl.libarary.pageAction.LoginPage">
  <!--Locator lists -->
  <locator type="" timeOut="3" value="//input[@name='account' and  not(@autocomplete)]">loginEmailInputBox</locator>
  <locator type="ByXpath" timeOut="3" value="//button[@class='sign-button submit' and text()='登錄']">loginButton</locator>
  <locator type="ByXpath" timeOut="3" value="//div[@class='top-nav-profile']//img[@class='avatar']">profile</locator>
  <locator type="ByXpath" timeOut="3" value="//input[@name='password' and @placeholder='密碼']">loginPasswordInputBox</locator>
  </page>
  </map>
  每一個Page對應一個真實的頁面,而每一個page下的Locator對應一個真實的頁面element

  之前定義過的Locator類如下:
package com.dbyl.libarary.utils;
/**
* This is for element library
*
* @author Young
*
*/
public class Locator {
private String element;
private int waitSec;
/**
* create a enum variable for By
*
* @author Young
*
*/
public enum ByType {
xpath, id, linkText, name, className, cssSelector, partialLinkText, tagName
}
private ByType byType;
public Locator() {
}
/**
* defaut Locator ,use Xpath
*
* @author Young
* @param element
*/
public Locator(String element) {
this.element = element;
this.waitSec = 3;
this.byType = ByType.xpath;
}
public Locator(String element, int waitSec) {
this.waitSec = waitSec;
this.element = element;
this.byType = ByType.xpath;
}
public Locator(String element, int waitSec, ByType byType) {
this.waitSec = waitSec;
this.element = element;
this.byType = byType;
}
public String getElement() {
return element;
}
public int getWaitSec() {
return waitSec;
}
public ByType getBy() {
return byType;
}
public void setBy(ByType byType) {
this.byType = byType;
}
}

上一頁123下一頁
軟件測試工具 | 聯系我們 | 投訴建議 | 誠聘英才 | 申請使用列表 | 網站地圖
滬ICP備07036474 2003-2017 版權所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd
主站蜘蛛池模板: 一区二区视频在线免费观看 | 视频在线观看一区二区三区 | 免看一级一片一在线看 | 久久久午夜视频 | 一本大道香蕉视频在线观看 | 久久精品视频免费 | 最新三级网站 | 久久99国产亚洲高清观看首页 | 一级黄色片网 | 毛片免费在线观看网址 | 91精品欧美综合在线观看 | 草草国产成人免费视频 | 黄色网络在线观看 | 国内视频一区二区三区 | 国产成人小视频 | 国产97视频 | 99视频在线观看免费视频 | 欧美极品另类高清videos | 一级做a爰全过程免费视频 一级做a爰片鸭王 | 国产成人精品一区二三区2022 | 91精品国产乱码在线观看 | 欧美一级一一特黄 | 日韩视频免费在线 | 曰鲁夜鲁鲁狠狠综合 | 国产精品自产拍视频观看 | 日本综合在线观看 | 亚洲视频在线视频 | 国产色丁香久久综合 | 日日碰狠狠添天天爽爽爽 | 亚洲欧美日韩中文字幕在线一区 | 久久精品伦理 | 成在线人永久免费播放视频 | 欧美一卡二卡科技有限公司 | 天天碰免费视频 | 黄色的视频免费 | 国产大片免费在线观看 | 欧美不卡精品中文字幕日韩 | 女人被男人扒开狂躁视频 | 99视频精品全部国产盗摄视频 | 播五月婷婷 | 国产精品密蕾丝视频 |