Package org.openqa.selenium.phantomjs

Examples of org.openqa.selenium.phantomjs.PhantomJSDriver.findElement()


                "})" +
            "}");

        phantom.get("http://ariya.github.com/js/random/");

        WebElement numbers = phantom.findElement(By.id("numbers"));
        boolean foundAtLeastOne = false;
        for(String number : numbers.getText().split(" ")) {
            foundAtLeastOne = true;
            assertEquals("42", number);
        }
View Full Code Here


        // Upload the temp file
        phantom.get(server.getBaseUrl() + "/common/upload.html");

        phantom.executePhantomJS("var page = this; page.uploadFile('input#"+ buttonId +"', '"+ testFile.getAbsolutePath() +"');");

        phantom.findElement(By.id("go")).submit();

        // Uploading files across a network may take a while, even if they're really small.
        // Wait for the loading label to disappear.
        WebDriverWait wait = new WebDriverWait(phantom, 10);
        wait.until(ExpectedConditions.invisibilityOfElementLocated(By.id("upload_label")));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.