Example usage for org.openqa.selenium.ie InternetExplorerDriver INITIAL_BROWSER_URL

List of usage examples for org.openqa.selenium.ie InternetExplorerDriver INITIAL_BROWSER_URL

Introduction

In this page you can find the example usage for org.openqa.selenium.ie InternetExplorerDriver INITIAL_BROWSER_URL.

Prototype

String INITIAL_BROWSER_URL

To view the source code for org.openqa.selenium.ie InternetExplorerDriver INITIAL_BROWSER_URL.

Click Source Link

Document

Capability that defines the initial URL to be used when IE is launched.

Usage

From source file:com.seleniumtests.ut.browserfactory.TestIECapabilityFactory.java

License:Apache License

@Test(groups = { "ut" })
public void testCreateDefaultIECapabilities() {

    MutableCapabilities capa = new IECapabilitiesFactory(config).createCapabilities();

    Assert.assertEquals(capa.getCapability(CapabilityType.BROWSER_NAME), "internet explorer");
    Assert.assertTrue((Boolean) capa.getCapability(InternetExplorerDriver.IGNORE_ZOOM_SETTING));
    Assert.assertTrue((Boolean) capa
            .getCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS));
    Assert.assertTrue((Boolean) capa.getCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION));
    Assert.assertEquals((String) capa.getCapability(InternetExplorerDriver.INITIAL_BROWSER_URL), "about:blank");
}

From source file:org.suren.autotest.web.framework.selenium.CapabilityConfig.java

License:Apache License

/**
 * ie?/*  www .  j  a  v a2 s.  com*/
 */
private void ie() {
    String initialUrl = enginePro.getProperty(DriverConstants.INITIAL_URL, "http://surenpi.com");

    DesiredCapabilities capability = DesiredCapabilities.internetExplorer();
    capability.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
    capability.setCapability(InternetExplorerDriver.INITIAL_BROWSER_URL, initialUrl);
    capability.setCapability(InternetExplorerDriver.REQUIRE_WINDOW_FOCUS, false);
    engineCapMap.put(DRIVER_IE, capability);
}

From source file:testrunner.orchestrator.TestOrchestrator.java

License:Apache License

public static void main(String[] args) throws Exception {
    String xmlPath = (args != null && args.length > 0 ? args[0] : null);
    if (xmlPath == null || xmlPath.trim().equals("")) {
        xmlPath = "/Users/daponn/personals/2014/selenium-Priya/testXML/TestHomePageAndSearch.xml";
    }/*from  ww  w .  j a v a  2  s  .  c om*/

    if (xmlPath == null || xmlPath.trim().equals("")) {
        System.out.println("No XML File is passed. Please pass an XML File to run the test");
        System.exit(0);
    }
    Test test = TestBuilder.buildTest(xmlPath);

    TestConfig testConfig = test.getTestConfig();
    System.out.println("The Test Object is :" + test);
    if (test == null || test.getFlows() == null || test.getFlows().isEmpty()) {
        System.out.println("The XML :" + xmlPath
                + " Seems to have no Flows defined. Please specify a Valid Test with Flows");
        System.exit(0);
    }
    int users = test.getUsers();
    if (users <= 0) {
        users = 1;
    }
    ExecutorService fixedPoolExecutor = Executors.newFixedThreadPool(users);

    WebDriver ffDriver = null;
    WebDriver chromeDriver = null;
    WebDriver ieDriver = null;
    System.out.println("The testConfig is " + testConfig);
    List<Future<TestResult>> testResults = new ArrayList<Future<TestResult>>();
    for (int user = 1; user <= users; user++) {

        if (testConfig.isEnableFireFox()) {

            FirefoxProfile seleniumProfile = null;
            ProfilesIni allProfile = new ProfilesIni();
            seleniumProfile = allProfile.getProfile("default");
            ffDriver = new FirefoxDriver(seleniumProfile);

            TestExecutor testExecutor = new TestExecutor(ffDriver, "FFTestUser:" + user);

            if (test.isResetCookies()) {
                ffDriver.manage().deleteAllCookies();
            }
            testExecutor.setCurrentTestToExecute(test);
            Future<TestResult> result = fixedPoolExecutor.submit(testExecutor);
            testResults.add(result);

        }
        if (testConfig.isEnableChrome()) {

            System.out.println("The Chrome path is " + testConfig.getChromePath());
            if (testConfig.getChromePath() != null) {
                System.setProperty("webdriver.chrome.driver", testConfig.getChromePath().trim());
            } else {
                System.setProperty("webdriver.chrome.driver", "c:\\Work\\Tools\\Selenium\\chromedriver.exe");
            }
            chromeDriver = new ChromeDriver();
            TestExecutor testExecutor = new TestExecutor(chromeDriver, "ChromeTestUser:" + user);
            if (test.isResetCookies()) {
                chromeDriver.manage().deleteAllCookies();
            }
            testExecutor.setCurrentTestToExecute(test);
            Future<TestResult> result = fixedPoolExecutor.submit(testExecutor);
            testResults.add(result);

        }
        if (testConfig.isEnableIE()) {
            System.setProperty("webdriver.ie.driver", testConfig.getIePath());
            DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
            caps.setCapability(InternetExplorerDriver.ENABLE_PERSISTENT_HOVERING, false);
            caps.setCapability(InternetExplorerDriver.INITIAL_BROWSER_URL, "about:blank");
            // caps.setCapability(InternetExplorerDriver.REQUIRE_WINDOW_FOCUS,
            // true);
            ieDriver = new InternetExplorerDriver(caps);
            TestExecutor testExecutor = new TestExecutor(ieDriver, "IETestUser:" + user);
            if (test.isResetCookies()) {
                ieDriver.manage().deleteAllCookies();
            }
            testExecutor.setCurrentTestToExecute(test);
            Future<TestResult> result = fixedPoolExecutor.submit(testExecutor);
            testResults.add(result);

        }
    }
    for (Future<TestResult> result : testResults) {
        TestResult testResult = result.get();
        System.out.println("Test Result is " + testResult);
    }
    fixedPoolExecutor.shutdown();
    System.out.println("The test is completed ");
}