本文整理汇总了Java中com.machinepublishers.jbrowserdriver.Settings类的典型用法代码示例。如果您正苦于以下问题:Java Settings类的具体用法?Java Settings怎么用?Java Settings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Settings类属于com.machinepublishers.jbrowserdriver包,在下文中一共展示了Settings类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: Adidas
import com.machinepublishers.jbrowserdriver.Settings; //导入依赖的package包/类
public Adidas(ProxyObject proxy, CredentialObject credentials, String url, boolean splash, boolean manual, double[] sizes) {
super();
Builder builder = Settings.builder();
if(proxy != null) {
builder.proxy(new ProxyConfig(Type.HTTP, proxy.getAddress(), proxy.getPort()));
//String server = proxy.getAddress() + ":" + proxy.getPort();
//capability.setCapability(CapabilityType.PROXY, new Proxy().setHttpProxy(server).setFtpProxy(server).setSslProxy(server));
}
builder.logsMax(0);
builder.loggerLevel(Level.OFF);
builder.userAgent(UserAgent.CHROME);
driver = new JBrowserDriver(builder.build());
driver.manage().timeouts().setScriptTimeout(30L, TimeUnit.SECONDS);
driver.manage().timeouts().pageLoadTimeout(30L, TimeUnit.SECONDS);
this.proxy = proxy;
this.url = url;
this.splash = splash;
this.manual = manual;
this.sizes = sizes;
carted = false;
}
开发者ID:Penor,项目名称:SneakerBot,代码行数:26,代码来源:Adidas.java
示例2: before
import com.machinepublishers.jbrowserdriver.Settings; //导入依赖的package包/类
@GwtIncompatible
@Before
public void before() {
// for correct stacktrace decoding, we need the debug info.
boolean debug = true;
// Convert to javascript
VertxUI.with(this.getClass(), null, debug, true);
// Start the headless browser
jBrowser = new JBrowserDriver(Settings.builder().logJavascript(true).build());
jBrowser.get("file:///" + new File(VertxUI.getTargetFolder(debug) + "/index.html").getAbsolutePath());
}
开发者ID:nielsbaloe,项目名称:vertxui,代码行数:14,代码来源:TestDOM.java
示例3: getDriver
import com.machinepublishers.jbrowserdriver.Settings; //导入依赖的package包/类
@Override
protected WebDriver getDriver() throws Exception
{
Capabilities capabilities = Settings.builder()
.headless(false)
.saveAttachments(true)
.screen(new Dimension(1200, 700))
.ssl("trustanything")
.timezone(Timezone.ASIA_TOKYO)
.buildCapabilities();
return new JBrowserDriver(capabilities);
}
开发者ID:hiroshitoda,项目名称:WebDriverBenchmark,代码行数:13,代码来源:JBrowserDriverBenchmarkTest.java
示例4: runJava
import com.machinepublishers.jbrowserdriver.Settings; //导入依赖的package包/类
private CompletableFuture<?> runJava(String javaSource) {
return MoreFutures.submitAsync(new Callable</*@Nullable*/ Void>() {
@Override
public @Nullable Void call() throws Exception {
Class<?> syntheticUserTestClass = Compilations.compile(javaSource);
// validation for default constructor and test method occurs on save
Constructor<?> defaultConstructor = syntheticUserTestClass.getConstructor();
Method method = syntheticUserTestClass.getMethod("test", WebDriver.class);
Settings.Builder settings = Settings.builder()
.requestHeaders(REQUEST_HEADERS)
.userAgent(userAgent);
HttpProxyConfig httpProxyConfig = configRepository.getHttpProxyConfig();
if (!httpProxyConfig.host().isEmpty()) {
int proxyPort = MoreObjects.firstNonNull(httpProxyConfig.port(), 80);
settings.proxy(new ProxyConfig(ProxyConfig.Type.HTTP, httpProxyConfig.host(),
proxyPort, httpProxyConfig.username(), httpProxyConfig.password()));
}
JBrowserDriver driver = new JBrowserDriver(settings.build());
try {
method.invoke(defaultConstructor.newInstance(), driver);
} finally {
driver.quit();
}
return null;
}
}, syntheticUserTestExecutor);
}
开发者ID:glowroot,项目名称:glowroot,代码行数:28,代码来源:SyntheticMonitorService.java
注:本文中的com.machinepublishers.jbrowserdriver.Settings类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论