• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java HttpClientFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.openqa.selenium.remote.internal.HttpClientFactory的典型用法代码示例。如果您正苦于以下问题:Java HttpClientFactory类的具体用法?Java HttpClientFactory怎么用?Java HttpClientFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



HttpClientFactory类属于org.openqa.selenium.remote.internal包,在下文中一共展示了HttpClientFactory类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: NodeProxy

import org.openqa.selenium.remote.internal.HttpClientFactory; //导入依赖的package包/类
public NodeProxy(RegistrationRequest request, Registry registry) {
    super(request, registry);
    remoteHost = new HttpHost(getRemoteHost().getHost(), getRemoteHost().getPort());
    HttpClientFactory httpClientFactory = new HttpClientFactory();
    client = httpClientFactory.getHttpClient();
    serviceUrl = getRemoteHost() + "/extra/RecorderServlet";
}
 
开发者ID:pojosontheweb,项目名称:selenium-utils,代码行数:8,代码来源:NodeProxy.java


示例2: createHttpClientFactory

import org.openqa.selenium.remote.internal.HttpClientFactory; //导入依赖的package包/类
public ApacheHttpClient.Factory createHttpClientFactory(SiteConfig siteConfig, DriverConfig driverConfig) {
    return new ApacheHttpClient.Factory(new HttpClientFactory(
            siteConfig.getConnectionRequestTimeout(), siteConfig.getSocketTimeout()));
}
 
开发者ID:brucezee,项目名称:jspider,代码行数:5,代码来源:WebDriverFactory.java


示例3: seleniumSetup

import org.openqa.selenium.remote.internal.HttpClientFactory; //导入依赖的package包/类
/**
 * Connect to selenium.
 *
 * @throws MalformedURLException
 */
@Before(order = ORDER_10, value = {"@mobile,@web"})
public void seleniumSetup() throws MalformedURLException {
    String grid = System.getProperty("SELENIUM_GRID");
    if (grid == null) {
        fail("Selenium grid not available");
    }
    String b = ThreadProperty.get("browser");

    if ("".equals(b)) {
        fail("Non available browsers");
    }

    String browser = b.split("_")[0];
    String version = b.split("_")[1];
    commonspec.setBrowserName(browser);
    commonspec.getLogger().debug("Setting up selenium for {}", browser);

    DesiredCapabilities capabilities = null;

    switch (browser.toLowerCase()) {
        case "chrome":
            ChromeOptions chromeOptions = new ChromeOptions();
            chromeOptions.addArguments("--no-sandbox");
            chromeOptions.addArguments("--ignore-certificate-errors");
            capabilities = DesiredCapabilities.chrome();
            capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
            break;
        case "firefox":
            capabilities = DesiredCapabilities.firefox();
            break;
        case "phantomjs":
            capabilities = DesiredCapabilities.phantomjs();
            break;
        case "iphone":
        case "safari":
            capabilities = DesiredCapabilities.iphone();
            capabilities.setCapability("platformName", "iOS");
            capabilities.setCapability("platformVersion", "8.1");
            capabilities.setCapability("deviceName", "iPhone Simulator");
            break;
        case "android":
            capabilities = DesiredCapabilities.android();
            capabilities.setCapability("platformName", "Android");
            capabilities.setCapability("platformVersion", "6.0");
            capabilities.setCapability("deviceName", "Android Emulator");
            capabilities.setCapability("app", "Browser");
            break;
        default:
            commonspec.getLogger().error("Unknown browser: " + browser);
            throw new SeleniumException("Unknown browser: " + browser);
    }

    capabilities.setVersion(version);

    grid = "http://" + grid + "/wd/hub";
    HttpClient.Factory factory = new ApacheHttpClient.Factory(new HttpClientFactory(60000, 60000));
    HttpCommandExecutor executor = new HttpCommandExecutor(new HashMap<String, CommandInfo>(), new URL(grid), factory);
    commonspec.setDriver(new RemoteWebDriver(executor, capabilities));
    commonspec.getDriver().manage().timeouts().pageLoadTimeout(PAGE_LOAD_TIMEOUT, TimeUnit.SECONDS);
    commonspec.getDriver().manage().timeouts().implicitlyWait(IMPLICITLY_WAIT, TimeUnit.SECONDS);
    commonspec.getDriver().manage().timeouts().setScriptTimeout(SCRIPT_TIMEOUT, TimeUnit.SECONDS);

    commonspec.getDriver().manage().deleteAllCookies();
    if (capabilities.getCapability("deviceName") == null) {
        commonspec.getDriver().manage().window().setSize(new Dimension(1440, 900));
    }
    commonspec.getDriver().manage().window().maximize();

}
 
开发者ID:Stratio,项目名称:bdt,代码行数:75,代码来源:HookGSpec.java


示例4: getHttpClientFactory

import org.openqa.selenium.remote.internal.HttpClientFactory; //导入依赖的package包/类
@Override
public HttpClientFactory getHttpClientFactory() {
    return null;
}
 
开发者ID:RetailMeNot,项目名称:SeleniumGridScaler,代码行数:5,代码来源:MockRemoteProxy.java



注:本文中的org.openqa.selenium.remote.internal.HttpClientFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DataInputOutputUtil类代码示例发布时间:2022-05-22
下一篇:
Java TestDialog类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap