Example usage for org.openqa.selenium.firefox FirefoxDriver FirefoxDriver

List of usage examples for org.openqa.selenium.firefox FirefoxDriver FirefoxDriver

Introduction

In this page you can find the example usage for org.openqa.selenium.firefox FirefoxDriver FirefoxDriver.

Prototype

public FirefoxDriver() 

Source Link

Usage

From source file:Testregdb1.java

@Before
public void setUp() throws Exception {
    driver = new FirefoxDriver();
    baseUrl = "https://www.dropbox.com";
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}

From source file:OrdenReaprovisionamientoTest.java

@BeforeClass
public static void setUp() throws Exception {
    driver = new FirefoxDriver();
    baseUrl = "http://localhost:8080";
    driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);

}

From source file:BallerinaEditorUITest.java

License:Open Source License

@Test(dataProvider = "getData")
public void openBallerinaFile(String fileName) throws IOException, InterruptedException,
        ParserConfigurationException, SAXException, TransformerException, URISyntaxException {

    //creating relevant browser webdriver
    //TODO make this generic for multiple browsers
    WebDriver driver = new FirefoxDriver();
    //opening base page - welcome page this case
    driver.get(TestConstants.SERVER_URL);
    //once the open button available click it
    waitAndGetElementByXpath(driver, TestConstants.WELCOME_PAGE_OPEN_BUTTON_XPATH).click();
    //fill the location of the ballerina file to be opened
    URL BallerinaResourceLocation = BallerinaEditorUITest.class
            .getResource(TestConstants.BALLERINA_RESOURCE_FOLDER + File.separator + fileName + ".bal");
    waitAndGetElementByXpath(driver, TestConstants.FILE_OPEN_POPUP_LOCATION_INPUT_XPATH)
            .sendKeys(BallerinaResourceLocation.getPath());
    //wait for the open button in the pop-up window
    waitAndGetElementByXpath(driver, TestConstants.FILE_OPEN_POPUP_LOCATION_OPEN_XPATH).click();
    //wait for the SVG element where the diagram is rendered
    WebElement domElement = waitAndGetElementByXpath(driver, TestConstants.SVG_XPATH);
    //Getting inner HTML of the SVG node
    String dom = TestUtils.preprocessDOMContent(domElement.getAttribute("innerHTML"));
    //TODO Add mechanism to generate DOM files
    //TestUtils.fileWriter(dom, fileName + "DOM.xml");
    URL DOMResourceLocation = BallerinaEditorUITest.class
            .getResource(TestConstants.DOM_RESOURCE_FOLDER + File.separator + fileName + "DOM.xml");
    //destroying browser instance
    driver.quit();//from  w  w  w.j a  va 2 s .com
    //checking inner content of the DOM element
    assertEquals("Rendered diagram of " + fileName + "is not equal to the expected diagram",
            TestUtils.fileReader(DOMResourceLocation.getPath()), dom);
}

From source file:ValidSubmission.java

public ValidSubmission() {
    driver = new FirefoxDriver();
    // String @"http://www.qaworks.com" ;
}

From source file:TestEdreamsTest.java

@Test
public void testSomeMethod() {
    // TODO review the generated test code and remove the default call to fail.
    WebDriver driver = new FirefoxDriver();
    driver.get("www.google.es");
    //Do some actions
    //driver.quit();
}

From source file:AddTask.java

@Before
public void setUp() throws Exception {
    driver = new FirefoxDriver();
    baseUrl = "http://localhost:8080/LoginWebApp/";
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}

From source file:ForumTestSelenium.java

@Before
public void setUp() throws Exception {
    driver = new FirefoxDriver();
    baseUrl = "http://192.168.0.19:8084";
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}

From source file:NewCarTest.java

@BeforeClass
public static void setUp() throws Exception {
    System.setProperty("webdriver.gecko.driver", "/Users/favl/Downloads/geckodriver");
    driver = new FirefoxDriver();
    driver.manage().window().maximize();
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
    driver.get("http://localhost:3000");
}

From source file:IntegracaoIT.java

@Test
public void testSimple() throws Exception {
    // Create a new instance of the Firefox driver
    // Notice that the remainder of the code relies on the interface, 
    // not the implementation.
    WebDriver driver = new FirefoxDriver();

    // And now use this to visit NetBeans
    driver.get("http://www.netbeans.org");
    // Alternatively the same thing can be done like this
    // driver.navigate().to("http://www.netbeans.org");

    // Check the title of the page
    // Wait for the page to load, timeout after 10 seconds
    (new WebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() {
        @Override//w  ww .  j a  v a2 s.com
        public Boolean apply(WebDriver d) {
            return d.getTitle().contains("NetBeans");
        }
    });

    //Close the browser
    driver.quit();
}

From source file:AddLicenseSeleniumTest.java

@Before
public void setUp() throws Exception {
    if (host != null && host.equals("localhost")) {
        baseUrl = "http://localhost:8080/";
        driver = new FirefoxDriver();
        driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
    } else {/*from  www.j a v  a  2s . c om*/
        baseUrl = "http://license-management.herokuapp.com/";
        DesiredCapabilities caps = DesiredCapabilities.chrome();
        caps.setCapability("platform", "Linux");
        caps.setCapability("version", "42.0");
        driver = new RemoteWebDriver(new URL(URL), caps);
    }
}