Package org.openqa.selenium

Examples of org.openqa.selenium.WebDriver


  @Test
  public void titleTest() {

    // Setup
    //System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver");
    WebDriver webDriver = new FirefoxDriver();

    // Exercise
    webDriver.get("http://10.0.55.154:8080/safebuy/registrarAlmacen.html");

    // Verify
    String title = webDriver.getTitle();
    Assert.assertEquals("Dream Live Website Template | Contact :: W3layouts", title);

    // Tear down
    webDriver.close();

  }
View Full Code Here


  @Test
  public void resgisterEmptyTest() {

    // Setup
    //System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver");
    WebDriver webDriver = new FirefoxDriver();

    // Exercise
    webDriver.get("http://10.0.55.154:8080/safebuy/registrarAlmacen.html");

    // Verify
    String title = webDriver.getTitle();
    Assert.assertEquals("Dream Live Website Template | Contact :: W3layouts", title);

    // Tear down
    webDriver.close();

  }
View Full Code Here

        // **************************************
        DesiredCapabilities capabilities = new DesiredCapabilities();
        Firebug.configure(new File("."), capabilities);
        // **************************************

        WebDriver driver = new FirefoxDriver(capabilities);

        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

        // page 1
        driver.get("http://twitter.com/#!/search-home");
        driver.findElement(By.xpath("//div[text() = 'Search']/../../input")).sendKeys("#WebPerfSD");

        // "page 2"
        driver.findElement(By.xpath("//div[text() = 'Search']")).click();
        driver.findElement(By.cssSelector(".tweet")); // wait for next page & tweets to appear

        // **************************************
        Thread.sleep(5000); // chill
        // **************************************

        driver.close();

    }
View Full Code Here

        // configure it as a desired capability
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability(CapabilityType.PROXY, proxy.seleniumProxy());

        WebDriver driver = new FirefoxDriver(capabilities);
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

        // start capture
        proxy.newHar("twitter.com");

        // page 1
        driver.get("http://twitter.com/#!/search-home");
        driver.findElement(By.xpath("//div[text() = 'Search']/../../input")).sendKeys("#WebPerfSD");

        // "page 2"
        driver.findElement(By.xpath("//div[text() = 'Search']")).click();
        driver.findElement(By.cssSelector(".tweet")); // wait for next page & tweets to appear

        // write the har file out
        proxy.getHar().writeTo(new File("/tmp/twitter.com.har"));

        driver.close();

    }
View Full Code Here

import java.util.concurrent.TimeUnit;

public class SimpleTest {
    public static void main(String[] args) {
        WebDriver driver = new FirefoxDriver();
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

        // page 1
        driver.get("http://twitter.com/#!/search-home");
        driver.findElement(By.xpath("//div[text() = 'Search']/../../input")).sendKeys("#WebPerfSD");

        // "page 2"
        driver.findElement(By.xpath("//div[text() = 'Search']")).click();
        driver.findElement(By.cssSelector(".tweet")); // wait for next page & tweets to appear

        driver.close();
    }
View Full Code Here

public class BootRStudio  {

   @Test
   public void testRStudioBoot() throws Exception {
       WebDriver driver = RStudioWebAppDriver.start();

       // Check the title of the page
       assertEquals(driver.getTitle(), "RStudio");

       // Close the browser
       RStudioWebAppDriver.stop();
   }
View Full Code Here

  }
   
  @Test
  public void canSetAndGetOrientationUsingTheWebDriverAPI() throws MalformedURLException {
    driver = new RemoteIOSDriver(getRemoteURL(), IOSCapabilities.iphone("Safari"));
    WebDriver d = new Augmenter().augment(driver);
    Rotatable rotator = ((Rotatable) d);
    rotator.rotate(LANDSCAPE);
    Assert.assertEquals(rotator.getOrientation(), LANDSCAPE);
    rotator.rotate(PORTRAIT);
    Assert.assertEquals(rotator.getOrientation(), PORTRAIT);
View Full Code Here

  }

  @Test(expectedExceptions = WebDriverException.class)
  public void detectUnsupportedOrientationWithTheWebDriverAPI() throws MalformedURLException {
    driver = new RemoteIOSDriver(getRemoteURL(), SampleApps.uiCatalogCap());
    WebDriver d = new Augmenter().augment(driver);
    Rotatable rotator = ((Rotatable) d);
    Assert.assertEquals(rotator.getOrientation(), PORTRAIT);
    rotator.rotate(LANDSCAPE);
  }
View Full Code Here

    File to = new File("ss.png");
    to.delete();

    Assert.assertFalse(to.exists());

    WebDriver screenshotter = new Augmenter().augment(driver);
    to = ((TakesScreenshot) screenshotter).getScreenshotAs(OutputType.FILE);
    Assert.assertTrue(to.exists());
  }
View Full Code Here

            return (WebDriver) instantiator.createInstance(configuration);
        }

        // this is a simple constructor which does not know anything advanced
        if (Validate.empty(implementationClassName)) {
            WebDriver driver = SecurityActions.newInstance(implementationClassName, new Class<?>[0], new Object[0],
                    WebDriver.class);
            return driver;
        }

        throw new IllegalStateException(
View Full Code Here

TOP

Related Classes of org.openqa.selenium.WebDriver

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.