当前位置: 首页>>代码示例>>Java>>正文


Java InternetExplorerDriverService类代码示例

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


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

示例1: configureBrowser

import org.openqa.selenium.ie.InternetExplorerDriverService; //导入依赖的package包/类
@Subscribe
public void configureBrowser(final BeforeWebDriverCreationEvent event) {

    switch (browser) {
        case "firefox": {
            // configure Firefox
        }
        case "chrome": {
            setPathToDriverIfExistsAndIsExecutable(relativePathToChromeDriver, ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY);
            // configure Chrome
            break;
        }
        case "ie": {
            setPathToDriverIfExistsAndIsExecutable(relativePathToIeDriver, InternetExplorerDriverService.IE_DRIVER_EXE_PROPERTY);
            // configure InternetExplorer
            break;
        }
        default: {
            throw new RuntimeException(String.format("Please configure one of the supported browsers in %s", JFunkConstants.SCRIPT_PROPERTIES));
        }
    }
}
 
开发者ID:mgm-tp,项目名称:jfunk,代码行数:23,代码来源:ConfigBrowser.java

示例2: InternetExplorer

import org.openqa.selenium.ie.InternetExplorerDriverService; //导入依赖的package包/类
/**
 * 本地初始化IE浏览器driver
 */
public InternetExplorer() {
    System.setProperty("webdriver.ie.driver", System.getProperty("user.dir") + Constants.IE_PATH);
    InternetExplorerDriverService service = (InternetExplorerDriverService) ((InternetExplorerDriverService.Builder) new InternetExplorerDriverService.Builder()
            .usingAnyFreePort()).build();
    DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
    capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);// 关闭保护模式,IE默认为开启模式
    capabilities.setCapability("unexpectedAlertBehaviour", "accept");
    this.driver = new InternetExplorerDriver(service, capabilities);
}
 
开发者ID:Airpy,项目名称:KeywordDrivenAutoTest,代码行数:13,代码来源:InternetExplorer.java

示例3: getIeConfigurado

import org.openqa.selenium.ie.InternetExplorerDriverService; //导入依赖的package包/类
private WebDriver getIeConfigurado(String proxy) {

		org.openqa.selenium.Proxy proxyy = new org.openqa.selenium.Proxy();
		proxyy.setHttpProxy(proxy);
		proxyy.setFtpProxy(proxy);
		proxyy.setSslProxy(proxy);
		proxyy.setAutodetect(false);

		DesiredCapabilities capabilities = DesiredCapabilities
				.internetExplorer();
		capabilities
				.setCapability(
						InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,
						false);
		capabilities.setCapability(CapabilityType.PROXY, proxyy);
		capabilities.setBrowserName("ie");

		ieService = new InternetExplorerDriverService.Builder()
				.usingDriverExecutable(new File(InterNavegador.PATH_IEX))
				.usingAnyFreePort().build();
		try {
			ieService.start();
		} catch (IOException e) {
			System.out.println(e);
		}
		return new RemoteWebDriver(ieService.getUrl(), capabilities);

		// return new InternetExplorerDriver(capabilities);

	}
 
开发者ID:confsoft,项目名称:FuncaoWeb,代码行数:31,代码来源:DriverInternetExplorer.java

示例4: createDriverService

import org.openqa.selenium.ie.InternetExplorerDriverService; //导入依赖的package包/类
@Override
public DriverService createDriverService() {
    Builder builder = new InternetExplorerDriverService.Builder();
    if (port != null) builder.usingPort(port);
    if (driverExecutable != null) builder.usingDriverExecutable(driverExecutable);
    if (environment != null) builder.withEnvironment(environment);
    if (logFile != null) builder.withLogFile(logFile);
    if (logLevel != null) builder.withLogLevel(InternetExplorerDriverLogLevel.valueOf(logLevel.toUpperCase()));
    if (engineImplementation != null) builder.withEngineImplementation(InternetExplorerDriverEngine.valueOf(engineImplementation.toUpperCase()));
    if (host != null) builder.withHost(host);
    if (extractPath != null) builder.withExtractPath(extractPath);
    if (silent != null) builder.withSilent(silent);
    return builder.build();
}
 
开发者ID:viltgroup,项目名称:minium,代码行数:15,代码来源:InternetExplorerDriverServiceProperties.java

示例5: getPathProperty

import org.openqa.selenium.ie.InternetExplorerDriverService; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public String getPathProperty() {
    return InternetExplorerDriverService.IE_DRIVER_EXE_PROPERTY;
}
 
开发者ID:QACore,项目名称:Java-Testing-Toolbox,代码行数:8,代码来源:InternetExplorerConfiguration.java

示例6: InternetExplorerDriver

import org.openqa.selenium.ie.InternetExplorerDriverService; //导入依赖的package包/类
public InternetExplorerDriver(InternetExplorerDriverService service) {
    super(new org.openqa.selenium.ie.InternetExplorerDriver(service));
}
 
开发者ID:KarlGong,项目名称:easyium-java,代码行数:4,代码来源:InternetExplorerDriver.java

示例7: createWebDriver

import org.openqa.selenium.ie.InternetExplorerDriverService; //导入依赖的package包/类
/**
 *
 * @return the webdriver
 * @throws IOException if there is a problem loading the
 *                     properties file
 */
private WebDriver createWebDriver() throws IOException {
	Resource propertiesFile = new ClassPathResource(
			"META-INF/spring/application.properties");
	Properties properties = new Properties();
	properties.load(propertiesFile.getInputStream());
	String webdriverMode = properties.getProperty("selenium.webdriver.mode", "local");
	String driverName = properties.getProperty("selenium.webdriver.impl", "org.openqa.selenium.firefox.FirefoxDriver");
	WebDriverBrowserType browser = WebDriverBrowserType.fromString(driverName);
	String display = properties.getProperty("selenium.display.port", ":0");
	if (webdriverMode.equals("local")) {
		switch (browser) {
		case CHROME:
			String chromeLocation = properties
			.getProperty("selenium.webdriver.chromedriver.location");
			Map<String,String> environment = new HashMap<String,String>();
			environment.put("DISPLAY", display);
			ChromeDriverService chromeService = new ChromeDriverService.Builder()
			.usingDriverExecutable(new File(chromeLocation))
			.usingAnyFreePort().withEnvironment(environment).build();
			chromeService.start();
			return new RemoteWebDriver(chromeService.getUrl(),
					DesiredCapabilities.chrome());
		case SAFARI:
			return new SafariDriver();
		case INTERNET_EXPLORER:
			String 	internetExplorerLocation = properties
			.getProperty("selenium.webdriver.ie.location");
			InternetExplorerDriverService ieService = InternetExplorerDriverService.createDefaultService();
			ieService.start();
			return new RemoteWebDriver(ieService.getUrl(),
					DesiredCapabilities.internetExplorer());
		case FIREFOX:
		default:
			FirefoxBinary firefoxBinary = new FirefoxBinary();
			firefoxBinary.setEnvironmentProperty("DISPLAY", display);
			ProfilesIni allProfiles = new ProfilesIni();
			FirefoxProfile profile = allProfiles.getProfile("default");
			return new FirefoxDriver(firefoxBinary, profile);
		}
	} else {

		DesiredCapabilities capabilities = new DesiredCapabilities();
		switch (browser) {
		case CHROME:
			capabilities = DesiredCapabilities.chrome();
			break;
		case INTERNET_EXPLORER:
			capabilities = DesiredCapabilities.internetExplorer();
			break;
		case SAFARI:
			capabilities = DesiredCapabilities.safari();
			break;
		case FIREFOX:
		default:
			capabilities = DesiredCapabilities.firefox();
		}
		String platformName = properties.getProperty("selenium.webdriver.platformName", "LINUX");
		WebDriverPlatformType platform = WebDriverPlatformType.valueOf(platformName);
		switch (platform) {
		case MAC:
			capabilities.setPlatform(Platform.MAC);
			break;
		case WINDOWS:
			capabilities.setPlatform(Platform.WINDOWS);
			break;
		case LINUX:
		default:
			capabilities.setPlatform(Platform.LINUX);
		}
		return new RemoteWebDriver(new URL("http://build.e-monocot.org:4444/wd/hub"), capabilities);
	}
}
 
开发者ID:RBGKew,项目名称:eMonocot,代码行数:79,代码来源:WebDriverFacade.java

示例8: createBrowser

import org.openqa.selenium.ie.InternetExplorerDriverService; //导入依赖的package包/类
public Browser createBrowser(int port) {
    InternetExplorerDriverService service = InternetExplorerDriverService.createDefaultService();
    DesiredCapabilities capabilities = getDefaultCapabilities();
    return createBrowser(new InternetExplorerDriver(service, capabilities, port));
}
 
开发者ID:testIT-WebTester,项目名称:webtester-core,代码行数:6,代码来源:InternetExplorerFactory.java

示例9: usingService

import org.openqa.selenium.ie.InternetExplorerDriverService; //导入依赖的package包/类
public InternetExplorerBrowserFactory usingService(InternetExplorerDriverService ieds) {
    service = ieds;
    return this;
}
 
开发者ID:darcy-framework,项目名称:darcy-webdriver,代码行数:5,代码来源:InternetExplorerBrowserFactory.java


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