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

您的位置:軟件測試 > 開源軟件測試 > 開源功能測試工具 > Selenium
Selenium webdriver操作日歷控件
作者:網絡轉載 發布時間:[ 2015/2/2 16:15:42 ] 推薦標簽:Selenium 功能測試工具

  其中:DriverFactory
package com.packt.webdriver.chapter3;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import org.openqa.selenium.Proxy;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeDriverService;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.firefox.internal.ProfilesIni;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.os.WindowsUtils;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
public class DriverFactory {
public static WebDriver getHtmlUnit()
{
HtmlUnitDriver ht=new HtmlUnitDriver();
return ht;
}
public static WebDriver getChromeDriver() {
// TODO Auto-generated method stub
String chromdriver="E:\chromedriver.exe";
System.setProperty("webdriver.chrome.driver", chromdriver);
ChromeDriverService.Builder builder=new  ChromeDriverService.Builder();
File file=new File(chromdriver);
//        int port=12643;
//        ChromeDriverService service=builder.usingDriverExecutable(file).usingPort(port).build();
//        try {
//            service.start();
//        } catch (IOException e) {
//            // TODO Auto-generated catch block
//            e.printStackTrace();
//        }
ChromeOptions options = new ChromeOptions();
options.addExtensions(new File(""));
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability("chrome.switches",
Arrays.asList("--start-maximized"));
options.addArguments("--test-type", "--start-maximized");
WebDriver driver=new ChromeDriver(options);
return driver;
}
public static WebDriver getFirefoxDriver()
{
try
{
WindowsUtils.tryToKillByName("firefox.exe");
}
catch(Exception e)
{
System.out.println("can not find firefox process");
}
File file=new File("d:\firebug-2.0.4-fx.xpi");
FirefoxProfile profile = new FirefoxProfile();
//        profile.setPreference("network.proxy.type", 2);
//        profile.setPreference("network.proxy.autoconfig_url", "http://proxy.successfactors.com:8083");
//        profile.setPreference("network.proxy.no_proxies_on", "localhost");
//
//        profile.setPreference("network.proxy.http", "proxy.domain.example.com");
//        profile.setPreference("network.proxy.http_port", 8080);
//        profile.setPreference("network.proxy.ssl", "proxy.domain.example.com");
//        profile.setPreference("network.proxy.ssl_port", 8080);
//        profile.setPreference("network.proxy.ftp", "proxy.domain.example.com");
//        profile.setPreference("network.proxy.ftp_port", 8080);
//        profile.setPreference("network.proxy.socks", "proxy.domain.example.com");
//        profile.setPreference("network.proxy.socks_port", 8080);
try {
profile.addExtension(file);
profile.setPreference("extensions.firebug.currentVersion", "2.0.4");
profile.setPreference("extensions.firebug.allPagesActivation", "on");
} catch (IOException e3) {
// TODO Auto-generated catch block
e3.printStackTrace();
}
WebDriver driver = new FirefoxDriver(profile);
return driver;
}
public static WebDriver getIEDriver()
{
String IEDriverServer="E:\IEDriverServer.exe";
System.setProperty("webdriver.ie.driver",IEDriverServer);
WebDriver driver=new InternetExplorerDriver();
return driver;
}
}

上一頁12下一頁
軟件測試工具 | 聯系我們 | 投訴建議 | 誠聘英才 | 申請使用列表 | 網站地圖
滬ICP備07036474 2003-2017 版權所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd
主站蜘蛛池模板: 欧美a欧美1级 | 成年人在线免费网站 | 国产成人免费片在线视频观看 | 国产一区国产二区国产三区 | 2019中文字幕在线观看 | 青青操国产 | 免费黄色小片 | 黄色短视频在线免费观看 | 欧美一a一片一级一片 | 日韩在线观看内窥镜 | a毛片a毛片a视频 | 精品国产日韩亚洲一区二区 | 国产成人福利 | 又爽又黄又无遮挡网站 | 高清黄色直接看 | 色黄污在线看黄污免费看黄污 | 久久本道综合色狠狠五月 | 岛国毛片一级一级特级毛片 | 国产最新精品2020好看的 | 在线精品日韩一区二区三区 | 成年人免费看 | 亚州毛色毛片免费观看 | 免费人成又黄又爽的视频强 | 欧美黑人巨大xxxx猛交 | 免费黄色短视频 | 国产欧美日韩精品第二区 | 日韩片在线观看 | 国产麻豆入在线观看 | 欧美最新一区二区三区四区 | 天天摸天天碰色综合网 | 4399一级成人毛片 | 91麻豆最新在线人成免费观看 | 国产精品h片在线播放 | 久久成人网18网站 | 成年人色网站 | 色综合久久久久久久久五月性色 | 国产精品国产三级在线高清观看 | 七色永久性tv网站免费看 | 欧美成人精品一区二三区在线观看 | 美国大黄一片免费看 | 99精品免费在线观看 |