亚洲好骚综合-亚洲黄色录像-亚洲黄色网址-亚洲黄色网址大全-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
主站蜘蛛池模板: 国产精品嫩草视频永久网址 | bt天堂中文资源在线 | 任你躁在线精品免费视频网站 | 国产小视频你懂的 | 伊人久久五月天综合网 | 网站午夜| 色豆豆永久免费网站 | 香蕉1024| 成年男人午夜片免费观看 | 成人黄视频| 亚洲视频第一页 | 日韩性大片免费 | 狠狠色狠狠色综合日日32 | 日日操天天爽 | 91视频网址入口 | 日韩欧美精品在线视频 | 毛片在线看片 | 国内精品小视频 | 97精品伊人久久久大香线蕉 | 伊人久久大香线蕉免费视频 | 国产精品亚洲欧美日韩久久 | 欧美综合自拍亚洲综合 | 免费在线观看日本 | 精品国产免费一区二区 | 国产精品久久久久久搜索 | 国产午夜久久影院 | 亚洲最大的视频网站 | 亚洲综合网国产福利精品一区 | 男女免费爽爽爽在线视频 | 国产日本欧美亚洲精品视 | 婷婷激情狠狠综合五月 | 国产成人18黄网站免费网站 | 女女同性一区二区三区四区 | 午夜精品视频在线 | 夜夜影视| 日本操穴 | 日本韩国一区二区 | 亚洲欧美中文字幕高清在线一 | 亚洲成人中文字幕 | 天天操天天射天天插 | 国产成本人三级在线观看网站 |