Package org.openqa.selenium

Examples of org.openqa.selenium.WebDriver.findElements()


        when(driver.findElement(By.id(BUTTON_ID))).thenReturn(button);
        when(driver.findElement(By.name(RADIO_NAME))).thenReturn(radioButton);
        when(driver.findElement(By.name(IMAGE_NAME))).thenReturn(image);

        when(driver.findElements(By.name(RADIO_NAME))).thenReturn(radioGroup);
        when(driver.findElements(By.id(TEXT_INPUT_ID))).thenReturn(textInputList);
        when(driver.findElements(By.id(HTML_ELEMENT_ID))).thenReturn(htmlElementList);
        when(driver.findElements(By.id(ELEMENT_ID))).thenReturn(webElementList);

        when(radioButton.getAttribute("name")).thenReturn(RADIO_NAME);
        String xpath = String.format("self::* | following::input[@type = 'radio' and @name = '%s'] | " +
View Full Code Here


        when(driver.findElement(By.name(RADIO_NAME))).thenReturn(radioButton);
        when(driver.findElement(By.name(IMAGE_NAME))).thenReturn(image);

        when(driver.findElements(By.name(RADIO_NAME))).thenReturn(radioGroup);
        when(driver.findElements(By.id(TEXT_INPUT_ID))).thenReturn(textInputList);
        when(driver.findElements(By.id(HTML_ELEMENT_ID))).thenReturn(htmlElementList);
        when(driver.findElements(By.id(ELEMENT_ID))).thenReturn(webElementList);

        when(radioButton.getAttribute("name")).thenReturn(RADIO_NAME);
        String xpath = String.format("self::* | following::input[@type = 'radio' and @name = '%s'] | " +
                "preceding::input[@type = 'radio' and @name = '%s']", RADIO_NAME, RADIO_NAME);
View Full Code Here

        when(driver.findElement(By.name(IMAGE_NAME))).thenReturn(image);

        when(driver.findElements(By.name(RADIO_NAME))).thenReturn(radioGroup);
        when(driver.findElements(By.id(TEXT_INPUT_ID))).thenReturn(textInputList);
        when(driver.findElements(By.id(HTML_ELEMENT_ID))).thenReturn(htmlElementList);
        when(driver.findElements(By.id(ELEMENT_ID))).thenReturn(webElementList);

        when(radioButton.getAttribute("name")).thenReturn(RADIO_NAME);
        String xpath = String.format("self::* | following::input[@type = 'radio' and @name = '%s'] | " +
                "preceding::input[@type = 'radio' and @name = '%s']", RADIO_NAME, RADIO_NAME);
        when(radioButton.findElements(By.xpath(xpath))).thenReturn(radioGroup);
View Full Code Here

              break;
            }
        }

        // And now list the suggestions
        List<WebElement> allSuggestions = driver.findElements(By.xpath("//td[@class='gac_c']"));

        for (WebElement suggestion : allSuggestions) {
            System.out.println(suggestion.getText());
        }
    }
View Full Code Here

        searchButton.click();

        wait.until(visibilityOfElementLocated(By.className("navend")));

        List<WebElement> results = driver.findElements(By.className("g"));

        screenSnapper.createSnapAndThumbnail(results);

        driver.quit();
    }
View Full Code Here

        Cookie flashMessageCookie = htmlUnitDriver.manage().getCookieNamed("FLASH_MESSAGE");
        assertThat(flashMessageCookie, is(nullValue()));


         assertThat(htmlUnitDriver.findElements(By.className("message")), is(Matchers.<WebElement>empty()));
    }

}
View Full Code Here

        Cookie flashMessageCookie = htmlUnitDriver.manage().getCookieNamed("FLASH_MESSAGE");
        assertThat(flashMessageCookie, is(nullValue()));


        assertThat(htmlUnitDriver.findElements(By.className("message")), is(Matchers.<WebElement>empty()));
    }

}
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.