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


Java BrowserVersion.FIREFOX_3_6属性代码示例

本文整理汇总了Java中com.gargoylesoftware.htmlunit.BrowserVersion.FIREFOX_3_6属性的典型用法代码示例。如果您正苦于以下问题:Java BrowserVersion.FIREFOX_3_6属性的具体用法?Java BrowserVersion.FIREFOX_3_6怎么用?Java BrowserVersion.FIREFOX_3_6使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.gargoylesoftware.htmlunit.BrowserVersion的用法示例。


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

示例1: getBrowserEnum

@SuppressWarnings("deprecation")
public BrowserVersion getBrowserEnum() {
       if (browserName.equals("Mozilla Firefox 3.6")) {
           return BrowserVersion.FIREFOX_3_6;
       }
       else if (browserName.equals("Mozilla Firefox 10")) {
           return BrowserVersion.FIREFOX_10;
       }
       else if (browserName.equals("Mozilla Firefox 17")) {
           return BrowserVersion.FIREFOX_17;
       }
       else if (browserName.equals("IE 6")) {
           return BrowserVersion.INTERNET_EXPLORER_6;
       } else if (browserName.equals("IE 7")) {
           return BrowserVersion.INTERNET_EXPLORER_7;
       } else if (browserName.equals("IE 8")) {
           return BrowserVersion.INTERNET_EXPLORER_8;
       }
       else if (browserName.equals("IE 9")) {
           return BrowserVersion.INTERNET_EXPLORER_9;
       }
       else if (browserName.equals("IE 10")) {
           return BrowserVersion.INTERNET_EXPLORER_10;
       }        
       return BrowserVersion.getDefault();
   }
 
开发者ID:fanghon,项目名称:webmonitor,代码行数:26,代码来源:Configuration.java

示例2: removeUser

public static void removeUser(String user) {
	Link.manager.closeAllWindows();
	Link.manager = new WebClient(BrowserVersion.FIREFOX_3_6);
	Link.manager.setCssEnabled(false);
	Link.manager.setJavaScriptEnabled(true);
	Link.manager.setRedirectEnabled(true);
	Link.manager.setThrowExceptionOnFailingStatusCode(false);
	Link.manager.setThrowExceptionOnScriptError(false);
	Link.manager.setPrintContentOnFailingStatusCode(false);

	loggedInToDesktop = false;
	loggedInToMobile = false;

	userLoggingIn = "";
	userPass = "";

	currentUser = "";

	try {
		Link.mobileManager.getPage("http://m.roblox.com/Account/LogOff");
	} catch (Exception e) {
		e.printStackTrace();
	}

	users.remove(user);
}
 
开发者ID:robinm8,项目名称:RoMessenger,代码行数:26,代码来源:LoginManager.java

示例3: changeUser

public static void changeUser(String user) {
	if (users.containsKey(user)) {
		userLoggingIn = user;
		userPass = users.get(user);

		Link.manager.closeAllWindows();
		Link.manager = new WebClient(BrowserVersion.FIREFOX_3_6);
		Link.manager.setCssEnabled(false);
		Link.manager.setJavaScriptEnabled(true);
		Link.manager.setRedirectEnabled(true);
		Link.manager.setThrowExceptionOnFailingStatusCode(false);
		Link.manager.setThrowExceptionOnScriptError(false);
		Link.manager.setPrintContentOnFailingStatusCode(false);
		loggedInToDesktop = false;
		loggedInToMobile = false;

		loginToRobloxMobile(user, users.get(user));
	}
	System.gc();
}
 
开发者ID:robinm8,项目名称:RoMessenger,代码行数:20,代码来源:LoginManager.java

示例4: addUser

public static void addUser(String user, String pass) {
	if (!users.containsKey(user)) {
		userLoggingIn = user;
		userPass = pass;

		Link.manager.closeAllWindows();
		Link.manager = new WebClient(BrowserVersion.FIREFOX_3_6);

		loggedInToDesktop = false;
		loggedInToMobile = false;

		loginToRobloxMobile(user, pass);
	}
}
 
开发者ID:robinm8,项目名称:RoMessenger,代码行数:14,代码来源:LoginManager.java

示例5: HackernewsMiner

public HackernewsMiner() {
    logger = LoggerFactory.getLogger(HackernewsMiner.class);
    wc = new WebClient(BrowserVersion.FIREFOX_3_6);
    wc.setThrowExceptionOnFailingStatusCode(false);
    wc.setJavaScriptEnabled(false);
    wc.setCssEnabled(false);
    props = HackernewsMinerProperties.props();
    rankMatch = Pattern.compile("is the (#([0-9]+) )?most popular language on GitHub");
    numReposMatch = Pattern.compile("Repositories \\(([0-9]+)\\)");
    httpDelay = Integer.parseInt(props.getProperty(PropNames.HTTP_DELAY, Defaults.HTTP_DELAY));
}
 
开发者ID:pridkett,项目名称:hackernews-miner,代码行数:11,代码来源:HackernewsMiner.java

示例6: init

@Before
    public void init() {
        if (urls == null) {
            Urls.initUrls(env.getRequiredProperty(PropertyNames.baseURL), env.getProperty(PropertyNames.superSearchBaseUrl));
            urls = Urls.FI;
        }

        String driverType = env.getProperty("test.web-driver", "hu");
        System.out.println("*** driverType = " + driverType);
        if ("ie".equals(driverType)) {
            driver = new InternetExplorerDriver();
            driver.get(urls.frontpage());
            driver.navigate().to("javascript:document.getElementById('overridelink').click()"); // to skip security certificate problem page
        }
        else if ("ff".equals(driverType)) {
            driver = new FirefoxDriver();
        }
//        else if ("safari".equals(driverType)) {
//            driver = new SafariDriver();
//        }
        else {
        	HtmlUnitDriver htmlUnitDriver =	new HtmlUnitDriver(BrowserVersion.FIREFOX_3_6);
            htmlUnitDriver.setJavascriptEnabled(true);
        	driver = htmlUnitDriver;
        }

        driver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS); // default is 0!!!
        driver.manage().timeouts().setScriptTimeout(50, TimeUnit.SECONDS); // default is 0!!!
        driver.manage().window().setSize(new Dimension(1024, 768));
        //driver.manage().timeouts().pageLoadTimeout(50, TimeUnit.SECONDS); // default is 0!!!
        
        if (urls == null) {
            Urls.initUrls("https://localhost:" + PORT, env.getProperty(PropertyNames.superSearchBaseUrl));
            urls = Urls.FI;
        }
        testHelper.dbCleanup();
        Long userIdOM = testHelper.createOMTestUserWithHash(OM_USER_SSN);
        System.out.println("*** OM user " + OM_USER_SSN + " created with id " + userIdOM);
        Long userIdVRK = testHelper.createVRKTestUserWithHash(VRK_USER_SSN);
        System.out.println("*** VRK user " + VRK_USER_SSN + " created with id " + userIdVRK);
    }
 
开发者ID:solita,项目名称:kansalaisaloite,代码行数:41,代码来源:WebTestBase.java

示例7: main

/**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws SQLException {
        if (args.length > 0 && args[0].equals("LOGIN")) {
            WebClient wc = new WebClient(BrowserVersion.FIREFOX_3_6);
            wc.setThrowExceptionOnScriptError(false);
            try {
                URL url = new URL(
                        "http://www.racingpost.com/horses2/cards/home.sd");
                HtmlPage hp = wc.getPage(url);
                HtmlAnchor a = hp.getAnchorByText("Racing Post Log in or Register");
                LOG.debug(a.click());
//                HtmlAnchor ha = hp.getAnchorByText("Racing Post Log in or Register");
//                HtmlPage loginPage = ha.click();
//                LOG.debug(loginPage.toString());
//                for (HtmlForm f : loginPage.getForms()) {
//                    LOG.debug(f.getNameAttribute());
//                }
            }
            catch (Exception ioe) {
                LOG.error(ioe.getMessage(), ioe);
                LOG.error("There was an error!");
            }
        }
        else {
            try {
                URL startPage = new URL(
                        "http://www.racingpost.com/horses2/cards/home.sd");
                WebPageDownloader wpd = new WebPageDownloader();
                WebPage wp = wpd.download(startPage);
                LOG.debug("Downloaded");
                MainPageProcessor mpp = new MainPageProcessor();
                LOG.debug("Creater Race Card Processor");
                ArrayList<MainPageProcessor.Result> mainPageResults =
                        mpp.process(wp);
                RaceCardProcessor rcp = new RaceCardProcessor();
                for (int i = 0; i < mainPageResults.size(); i++) {
                    MainPageProcessor.Result mpr = mainPageResults.get(i);
                    WebPage page = wpd.download(mpr.url);
                    rcp.process(mpr.race, mpr.date, page);
                }
                System.exit(0);
            }
            catch (MalformedURLException mue) {}
        }
    }
 
开发者ID:etothepii,项目名称:haddock,代码行数:47,代码来源:Main.java

示例8: main

public static void main(String[] args) throws FailingHttpStatusCodeException, MalformedURLException, IOException {
	WebClient webClient = new WebClient(BrowserVersion.FIREFOX_3_6);
	HtmlPage page = webClient.getPage("http://detail.tmall.com/item.htm?id=12923356887");
	System.out.println(page.asXml());
}
 
开发者ID:Tassemble,项目名称:delicious,代码行数:5,代码来源:WebClientUtils.java


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