亚洲好骚综合-亚洲黄色录像-亚洲黄色网址-亚洲黄色网址大全-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
主站蜘蛛池模板: 高清不卡毛片 | 日本精品久久久免费高清 | 1717she永久精品免费 | 免费人欧美成又黄又爽的视频 | 日韩资源站 | 国产精品1区2区 | 欧美亚洲国产一区二区三区 | 香蕉视频在线观 | 无遮挡黄动漫在线观看播放 | 中文天堂在线www | 欧美精品福利 | 91久久亚洲最新一本 | 91免费看国产 | 一级大片免费观看 | 在线免费黄网 | 久中文字幕中文字幕亚洲无线 | 日本黄色免费在线观看 | 国产视频99 | 日韩欧美理论片 | 日日操免费视频 | 国产成人综合久久亚洲精品 | 国产亚洲情侣一区二区无 | 在线免费看黄的网站 | 成a人片在线观看 | 免费麻豆国产黄网站在线观看 | 国产欧美日韩视频免费61794 | 国产高清一区二区三区四区 | 一个人看的www视频免费 | 玖玖成人网| 日本一区二区三区在线观看视频 | 一级黄色大片免费观看 | 成人免费网站在线观看 | 日韩亚洲欧美性感视频影片免费看 | 成人h免费观看视频 | 亚洲丁香色婷婷综合欲色啪 | 国产一级一级 | 欧美日一区二区三区 | 欧美日韩免费一区二区三区 | 欧洲在线视频 | 欧美视频一区二区三区在线观看 | 手机看片国产免费久久网 |