本文整理汇总了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();
}
示例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);
}
示例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();
}
示例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);
}
}
示例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));
}
示例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);
}
示例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) {}
}
}
示例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());
}