Search in sources :

Example 81 with WebElement

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]")));
}
Also used : WebElement(org.openqa.selenium.WebElement) Test(org.junit.Test)

Example 82 with WebElement

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;
        }
    }
}
Also used : Random(java.util.Random) WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait) WebElement(org.openqa.selenium.WebElement)

Example 83 with WebElement

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;
}
Also used : WebElement(org.openqa.selenium.WebElement) NoSuchElementException(org.openqa.selenium.NoSuchElementException)

Example 84 with WebElement

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;
}
Also used : WebElement(org.openqa.selenium.WebElement) NoSuchElementException(org.openqa.selenium.NoSuchElementException)

Example 85 with WebElement

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);
}
Also used : WebElement(org.openqa.selenium.WebElement)

Aggregations

WebElement (org.openqa.selenium.WebElement)520 Test (org.junit.Test)96 WebDriver (org.openqa.selenium.WebDriver)85 PublicAtsApi (com.axway.ats.common.PublicAtsApi)57 Actions (org.openqa.selenium.interactions.Actions)55 FirefoxDriver (org.openqa.selenium.firefox.FirefoxDriver)46 WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)40 By (org.openqa.selenium.By)36 URL (java.net.URL)35 RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)34 RealHtmlElementState (com.axway.ats.uiengine.utilities.realbrowser.html.RealHtmlElementState)30 JavascriptExecutor (org.openqa.selenium.JavascriptExecutor)21 NoSuchElementException (org.openqa.selenium.NoSuchElementException)21 HiddenHtmlElementState (com.axway.ats.uiengine.utilities.hiddenbrowser.HiddenHtmlElementState)19 ArrayList (java.util.ArrayList)18 SeleniumOperationException (com.axway.ats.uiengine.exceptions.SeleniumOperationException)13 Select (org.openqa.selenium.support.ui.Select)13 TimeoutException (org.openqa.selenium.TimeoutException)12 VisualEditorPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject)11 List (java.util.List)10