Package com.gargoylesoftware.htmlunit

Examples of com.gargoylesoftware.htmlunit.BrowserVersion


     * The domain www.bbc.co.uk should be trimmable only down to bbc.co.uk
     * trimming to co.uk should not be possible.
     * @param newDomain the new domain to set
     */
    public void jsxSet_domain(final String newDomain) {
        final BrowserVersion browserVersion = getBrowserVersion();

        // IE (at least 6) doesn't allow to set domain of about:blank
        if (WebClient.URL_ABOUT_BLANK == getPage().getWebResponse().getRequestSettings().getUrl()
            && browserVersion.isIE()) {
            throw Context.reportRuntimeError("Illegal domain value, cannot set domain from about:blank to: \""
                    + newDomain + "\"");
        }

        final String currentDomain = jsxGet_domain();
View Full Code Here


     */
    @Override
    public void setDomNode(final DomNode domNode) {
        super.setDomNode(domNode);
        final HtmlElement element = (HtmlElement) domNode;
        final BrowserVersion browserVersion = getBrowserVersion();
        if (browserVersion.isIE()) {
            if ((element instanceof HtmlAbbreviated && browserVersion.getBrowserVersionNumeric() > 6)
                || element instanceof HtmlAcronym
                || element instanceof HtmlAddress
                || element instanceof HtmlBidirectionalOverride
                || element instanceof HtmlBig
                || element instanceof HtmlBold
                || element instanceof HtmlBlink
                || element instanceof HtmlCenter
                || element instanceof HtmlCitation
                || element instanceof HtmlCode
                || element instanceof HtmlDefinition
                || element instanceof HtmlExample
                || element instanceof HtmlEmphasis
                || element instanceof HtmlItalic
                || element instanceof HtmlKeyboard
                || element instanceof HtmlListing
                || element instanceof HtmlNoBreak
                || element instanceof HtmlPlainText
                || element instanceof HtmlS
                || element instanceof HtmlSample
                || element instanceof HtmlSmall
                || element instanceof HtmlStrike
                || element instanceof HtmlStrong
                || element instanceof HtmlSubscript
                || element instanceof HtmlSuperscript
                || element instanceof HtmlTeletype
                || element instanceof HtmlUnderlined
                || element instanceof HtmlVariable) {
                ActiveXObject.addProperty(this, "cite", true, true);
            }
            if ((element instanceof HtmlAbbreviated && browserVersion.getBrowserVersionNumeric() > 6)
                    || element instanceof HtmlAcronym
                    || element instanceof HtmlBold
                    || element instanceof HtmlBidirectionalOverride
                    || element instanceof HtmlBig
                    || element instanceof HtmlBlink
View Full Code Here

        isJBoss4 = version.startsWith("4");


        // Browser branch and version

        BrowserVersion browserVersion = BrowserVersion.FIREFOX_3;

        String browserProp = System.getProperty("htmlunit.browser");
        if( "ff3".equals(browserProp) || "firefox3".equals(browserProp) ){
          browserVersion = BrowserVersion.FIREFOX_3;
        }else
        if( "ff2".equals(browserProp) || "firefox2".equals(browserProp) ){
          browserVersion = BrowserVersion.FIREFOX_2;
        }else
        if( "ie7".equals(browserProp) || "internetexplorer7".equals(browserProp) ){
          browserVersion = BrowserVersion.INTERNET_EXPLORER_7_0;
        }else
        if( "ie6".equals(browserProp) || "internetexplorer6".equals(browserProp) ){
          browserVersion = BrowserVersion.INTERNET_EXPLORER_6_0;
        }
       
        log.info("Simulating browser: "+browserVersion.getNickName() + "('htmlunit.browser' sysprop: "+browserProp+")");


       
       
        // Initial JSF request
View Full Code Here

      args = "FF17";
    }
    Set<BrowserVersion> browserSet = new HashSet<BrowserVersion>();
    Set<String> userAgentSet = new HashSet<String>();
    for (String browserName : args.split(",")) {
      BrowserVersion browser = BROWSER_MAP.get(browserName);
      if (browser == null) {
        getLogger().log(
            TreeLogger.ERROR,
            "RunStyleHtmlUnit: Unknown browser " + "name " + browserName
                + ", expected browser name: one of " + BROWSER_MAP.keySet());
View Full Code Here

        }

        // Let's tweak WebClient

        String headlessBrowser = System.getProperty("headlessBrowser", "FIREFOX_24");
        BrowserVersion browserVersion;
        if ("CHROME".equals(headlessBrowser)) {
            browserVersion = BrowserVersion.CHROME;
        } else if ("FIREFOX_17".equals(headlessBrowser)) {
            browserVersion = BrowserVersion.FIREFOX_17;
        } else if ("INTERNET_EXPLORER_8".equals(headlessBrowser)) {
View Full Code Here

        }

        // Let's tweak WebClient

        String headlessBrowser = System.getProperty("headlessBrowser", "INTERNET_EXPLORER_8");
        BrowserVersion browserVersion;
        if ("FIREFOX_3".equals(headlessBrowser)) {
            browserVersion = BrowserVersion.FIREFOX_3;
        } else if ("FIREFOX_3_6".equals(headlessBrowser)) {
            browserVersion = BrowserVersion.FIREFOX_3_6;
        } else if ("INTERNET_EXPLORER_6".equals(headlessBrowser)) {
View Full Code Here

            log.log(Level.WARNING,
                    "Creating HtmlUnitDriver using legacy configuration. ApplicationName={0} ApplicationVersion={1} UserAgent={2} BrowserVersionNumeric={3}",
                    new Object[] { applicationName, applicationVersion, userAgent, browserVersionNumeric });

            return SecurityActions.newInstance(configuration.getImplementationClass(), new Class<?>[] { BrowserVersion.class },
                    new Object[] { new BrowserVersion(applicationName, applicationVersion, userAgent, browserVersionNumeric) },
                    HtmlUnitDriver.class);
        }
    }
View Full Code Here

      // If no browsers specified, default to Firefox 3.
      args = "FF3";
    }
    Set<BrowserVersion> browserSet = new HashSet<BrowserVersion>();
    for (String browserName : args.split(",")) {
      BrowserVersion browser = BROWSER_MAP.get(browserName);
      if (browser == null) {
        getLogger().log(
            TreeLogger.ERROR,
            "RunStyleHtmlUnit: Unknown browser " + "name " + browserName
                + ", expected browser name: one of " + BROWSER_MAP.keySet());
View Full Code Here

      }
      if ( "opera".equalsIgnoreCase( browserDriver ) ) {
        return new SeleniumStarter( Driver.opera, new OperaDriver() );
      }
      if ( "htmlUnit".equalsIgnoreCase( browserDriver ) ) {
        BrowserVersion browser = BrowserVersion.getDefault();
        System.out.println( "HtmlUnit's default User Agent: " + browser.getUserAgent() );
        browser.setBrowserLanguage( "no-no" );
        HtmlUnitDriver driver = new HtmlUnitDriver( browser );
        driver.setJavascriptEnabled( true );
        return new SeleniumStarter( Driver.htmlUnit, driver );
      }
    } catch ( Throwable t ) {
View Full Code Here

      // If no browsers specified, default to Firefox 3.
      args = "FF3";
    }
    Set<BrowserVersion> browserSet = new HashSet<BrowserVersion>();
    for (String browserName : args.split(",")) {
      BrowserVersion browser = BROWSER_MAP.get(browserName);
      if (browser == null) {
        getLogger().log(
            TreeLogger.ERROR,
            "RunStyleHtmlUnit: Unknown browser " + "name " + browserName
                + ", expected browser name: one of " + BROWSER_MAP.keySet());
View Full Code Here

TOP

Related Classes of com.gargoylesoftware.htmlunit.BrowserVersion

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.