List of usage examples for org.openqa.selenium WebDriver get
void get(String url);
From source file:edu.uga.cs.clickminer.test.BrowserEngineTest.java
License:Open Source License
/** * <p>browserEngineTest_11.</p> *///from ww w.ja va 2s .c om public static void browserEngineTest_11() { FirefoxProfile profile = new FirefoxProfile( TestUtils.getWebdriverProfile("/home/cjneasbi/.mozilla/firefox", "webdriver")); WebDriver wdriver = new FirefoxDriver(null, profile, TestUtils.createProxyConfig()); //ProxyClient pc = new ProxyClient("127.0.0.1", 8888); //BrowserEngine bengine = new BrowserEngine(pc, wdriver); wdriver.get("http://cnn-f.akamaihd.net/crossdomain.xml"); try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } List<WebElement> sresult = wdriver.findElements(By.xpath("//*")); for (WebElement elem : sresult) { System.out.println(elem.getTagName()); } }
From source file:edu.uga.cs.clickminer.test.BrowserEngineTest.java
License:Open Source License
/** * <p>browserEngineTest_15.</p> *///from ww w. j av a 2 s . com public static void browserEngineTest_15() { FirefoxProfile profile = new FirefoxProfile( TestUtils.getWebdriverProfile("/home/cjneasbi/.mozilla/firefox", "webdriver")); WebDriver wdriver = new FirefoxDriver( new FirefoxBinary(new File("/home/cjneasbi/Desktop/old_firefox/firefox-14.0.1/firefox-bin")), profile); wdriver.get("http://www.cs.uga.edu/~neasbitt/"); try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } WebElement elem = wdriver.findElement(By.id("logo")); JSUtils.setElementAttribute(wdriver, elem, "id", "logologologo1"); try { elem = wdriver.findElement(By.id("logologologo1")); System.out.println("Pass"); } catch (NoSuchElementException e) { System.out.println("Fail"); } wdriver.close(); }
From source file:edu.uga.cs.clickminer.test.BrowserEngineTest.java
License:Open Source License
/** * <p>browserEngineTest_16.</p> * * @throws java.io.IOException if any.// w w w . j a va 2 s . c om * @throws java.lang.InterruptedException if any. */ public static void browserEngineTest_16() throws IOException, InterruptedException { FirefoxProfile profile = new FirefoxProfile( TestUtils.getWebdriverProfile("/home/cjneasbi/.mozilla/firefox", "webdriver")); WebDriver wdriver = new FirefoxDriver( new FirefoxBinary(new File("/home/cjneasbi/Desktop/old_firefox/firefox-17.0/firefox-bin")), profile); // WebDriver wdriver = new FirefoxDriver(); wdriver.get("http://www.cs.uga.edu/~neasbitt/"); wdriver.switchTo().activeElement(); Thread.sleep(10000); WebElement elem = wdriver.findElement(By.id("logo")); List<String> locator = JSUtils.getElementLocator(wdriver, elem); for (String s : locator) { System.out.println(s); } wdriver.close(); }
From source file:edu.uga.cs.clickminer.test.BrowserEngineTest.java
License:Open Source License
/** * <p>browserEngineTest_17.</p> * * @throws java.io.IOException if any.// w w w .j av a 2 s. c om * @throws java.lang.InterruptedException if any. * @throws edu.uga.cs.clickminer.exception.ProxyErrorException if any. */ public static void browserEngineTest_17() throws IOException, InterruptedException, ProxyErrorException { FirefoxProfile profile = new FirefoxProfile( TestUtils.getWebdriverProfile("/home/cjneasbi/.mozilla/firefox", "webdriver")); WebDriver wdriver = new FirefoxDriver( new FirefoxBinary(new File("/home/cjneasbi/Desktop/old_firefox/firefox-17.0/firefox-bin")), profile, TestUtils.createProxyConfig()); ProxyClient pc = new ProxyClient("127.0.0.1", 8888); BrowserEngine bengine = new BrowserEngine(pc, wdriver, true, true); wdriver.get("file:///home/cjneasbi/workspace/clickminer-browser/resource/test/js_test.html"); wdriver.switchTo().activeElement(); Thread.sleep(5000); List<WebElement> elements = bengine.findJSClickableElements(); for (WebElement elem : elements) { System.out.println(elem.getAttribute("id")); } bengine.close(); }
From source file:edu.uga.cs.clickminer.test.BrowserEngineTest.java
License:Open Source License
/** * <p>browserEngineTest_18.</p> * * @throws java.io.IOException if any.//from ww w . j ava 2 s . c om * @throws java.lang.InterruptedException if any. */ public static void browserEngineTest_18() throws IOException, InterruptedException { FirefoxProfile profile = new FirefoxProfile( TestUtils.getWebdriverProfile("/home/cjneasbi/.mozilla/firefox", "webdriver")); WebDriver wdriver = new FirefoxDriver( new FirefoxBinary(new File("/home/cjneasbi/Desktop/old_firefox/firefox-17.0/firefox-bin")), profile); // WebDriver wdriver = new FirefoxDriver(); wdriver.get("http://www.cs.uga.edu/~neasbitt/"); wdriver.switchTo().activeElement(); Thread.sleep(5000); WebElement elem = wdriver.findElement(By.id("profile")); Map<String, String> attrs = JSUtils.getElementAttributes(wdriver, elem); System.out.println(attrs); wdriver.close(); }
From source file:edu.uga.cs.clickminer.test.BrowserEngineTest.java
License:Open Source License
/** * <p>browserEngineTest_19.</p> * * @throws edu.uga.cs.clickminer.exception.ProxyErrorException if any. * @throws java.lang.InterruptedException if any. *///from ww w .ja va 2s . co m public static void browserEngineTest_19() throws ProxyErrorException, InterruptedException { FirefoxProfile profile = new FirefoxProfile( TestUtils.getWebdriverProfile("/home/cjneasbi/.mozilla/firefox", "webdriver")); WebDriver wdriver = new FirefoxDriver( new FirefoxBinary(new File("/home/cjneasbi/Desktop/old_firefox/firefox-17.0/firefox-bin")), profile, TestUtils.createProxyConfig()); for (int i = 0; i < 10; i++) { //wdriver.get("http://choices.truste.com/get?name=admarker-full-tr.png"); wdriver.get("http://blah.blah.com"); Thread.sleep(5000); } wdriver.quit(); }
From source file:edu.uga.cs.clickminer.test.ProxyClientTest.java
License:Open Source License
/** * <p>proxyClientTest_7.</p> * * @throws java.lang.Exception if any./* w w w.j a v a 2 s .c om*/ */ public static void proxyClientTest_7() throws Exception { FirefoxProfile profile = new FirefoxProfile( TestUtils.getWebdriverProfile("/home/cjneasbi/.mozilla/firefox", "webdriver")); WebDriver wdriver = new FirefoxDriver( new FirefoxBinary(new File("/home/cjneasbi/Desktop/old_firefox/firefox-14.0.1/firefox-bin")), profile, TestUtils.createProxyConfig()); ProxyClient pc = new ProxyClient("127.0.0.1", 8888); pc.setModeNoContent("http://www.newegg.com"); if (pc.getMode() == ProxyMode.NOCONTENT) { System.out.println("Pass"); } else { System.out.println("Fail"); } wdriver.get("http://www.yahoo.com"); Thread.sleep(2000); if (pc.getMode() == ProxyMode.NOCONTENT) { System.out.println("Pass"); } else { System.out.println("Fail"); } wdriver.get("http://www.newegg.com"); Thread.sleep(2000); if (pc.getMode() == ProxyMode.CONTENT) { System.out.println("Pass"); } else { System.out.println("Fail"); } wdriver.close(); }
From source file:edu.uga.cs.clickminer.test.WindowStateTest.java
License:Open Source License
/** * <p>windowStateTest_1.</p> * * @throws java.lang.InterruptedException if any. *//*from www .j ava2s .c o m*/ public static void windowStateTest_1() throws InterruptedException { WebDriver wdriver = new FirefoxDriver(); wdriver.get("http://www.google.com"); WindowState bstate = new WindowState(null, wdriver, wdriver.getWindowHandle()); Thread.sleep(2000); // not the best way to do this, but quick and dirty System.out.println(bstate.getPageHash()); }
From source file:edu.uga.cs.clickminer.test.WindowStateTest.java
License:Open Source License
/** * <p>windowStateTest_2.</p> * * @throws java.lang.Exception if any./*w w w .jav a2 s .c om*/ */ public static void windowStateTest_2() throws Exception { long poll_interval = 10000; WebDriver wdriver = new FirefoxDriver(TestUtils.createProxyConfig()); ProxyClient pclient = new ProxyClient("127.0.0.1", 8888); wdriver.get("http://www.google.com"); WindowState bstate = new WindowState(pclient, wdriver, wdriver.getWindowHandle()); Thread.sleep(2000); // not the best way to do this, but quick and dirty while (!bstate.isResting()) { try { System.out.println(bstate); Thread.sleep(poll_interval); } catch (InterruptedException e) { e.printStackTrace(); } } System.out.println("The browser is in a resting state."); System.out.println(bstate); bstate.reset(); wdriver.quit(); }
From source file:edu.umd.cs.guitar.ripper.WebApplicationTest.java
License:Open Source License
@Test public void testConnectFireFox() { String URL = "http://www.google.com/analytics/"; WebDriver driver = new FirefoxDriver(); driver.get(URL); System.out.println("DONE"); }