use of org.openqa.selenium.WebElement in project opennms by OpenNMS.
the class SupportPageIT method testAllFormsArePresent.
@Test
public void testAllFormsArePresent() throws InterruptedException {
final WebElement form = m_driver.findElement(By.cssSelector("form[action='support/index.htm']"));
assertNotNull(form);
assertNotNull(form.findElement(By.cssSelector("input[type=text][name=username]")));
assertNotNull(form.findElement(By.cssSelector("input[type=password][name=password]")));
}
use of org.openqa.selenium.WebElement in project SneakerBot by Penor.
the class Adidas method atc.
public void atc() {
WebDriverWait wait = new WebDriverWait(driver, 300L);
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//*[@class='ffSelectButton' and (.//span[text()[contains(.,'Size')]] or .//span[text()[contains(.,'size')]])]")));
int index = new Random().nextInt(sizes.length);
String sizeToPick = Double.toString(sizes[index]);
for (WebElement e : driver.findElements(By.xpath("//div[@class='ffSelectMenuMid' and .//ul[.//li[.//span[text()[contains(.,'size')]]]]]/ul/li"))) {
String size = e.getText().trim();
if (size != null && size.equals(sizeToPick)) {
e.click();
break;
}
}
}
use of org.openqa.selenium.WebElement in project selenium-tests by Wikia.
the class Elements method getElementByText.
public static WebElement getElementByText(List<WebElement> elements, String value) {
WebElement foundElement = null;
for (WebElement element : elements) {
if (element.getText().equalsIgnoreCase(value)) {
foundElement = element;
PageObjectLogging.log("getElementByText", "Element with text: " + value + " is found from the list", true);
break;
}
}
if (foundElement == null) {
throw new NoSuchElementException("Element with text: " + value + " is not found from the list");
}
return foundElement;
}
use of org.openqa.selenium.WebElement in project selenium-tests by Wikia.
the class Elements method getElementByChildText.
public static WebElement getElementByChildText(List<WebElement> elements, By childBySelector, String value) {
WebElement foundElement = null;
for (WebElement element : elements) {
if (element.findElement(childBySelector).getText().equalsIgnoreCase(value)) {
foundElement = element;
PageObjectLogging.log("getElementByChildText", "Element's child with text: " + value + " is found from the list", true);
break;
}
}
if (foundElement == null) {
throw new NoSuchElementException("Element's child with text: " + value + " is not found from the list");
}
return foundElement;
}
use of org.openqa.selenium.WebElement in project selenium-tests by Wikia.
the class VideoComponentObject method verifyVideoAnyclipEmbed.
public void verifyVideoAnyclipEmbed() {
WebElement container = videoEmbed.findElement(By.tagName("div"));
String containerId = "ACPContainer0";
Assertion.assertStringContains(container.getAttribute("id"), containerId);
WebElement object = container.findElement(By.tagName("object"));
wait.forElementVisible(object);
Assertion.assertStringContains(getVideoPlayerObject().getAttribute("value"), object.getAttribute("id"));
PageObjectLogging.log("verifyVideoAnyclipEmbed", "Anyclip video is embedded", true);
}
Aggregations