Search in sources :

Example 16 with WebElement

use of org.openqa.selenium.WebElement in project rstudio by rstudio.

the class ConsoleTestUtils method resumeConsoleInteraction.

public static void resumeConsoleInteraction(WebDriver driver) {
    // Click on the console
    WebElement console = driver.findElement(By.id(ElementIds.getElementId(ElementIds.SHELL_WIDGET)));
    console.click();
}
Also used : WebElement(org.openqa.selenium.WebElement)

Example 17 with WebElement

use of org.openqa.selenium.WebElement in project rstudio by rstudio.

the class ConsoleTestUtils method waitForConsoleContainsText.

public static void waitForConsoleContainsText(WebDriver driver, final String text) {
    final WebElement output = driver.findElement(By.id(ElementIds.getElementId(ElementIds.CONSOLE_OUTPUT)));
    (new WebDriverWait(driver, 5)).until(new ExpectedCondition<Boolean>() {

        public Boolean apply(WebDriver d) {
            String outputText = output.getText();
            return outputText.contains(text);
        }
    });
}
Also used : WebDriver(org.openqa.selenium.WebDriver) WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait) WebElement(org.openqa.selenium.WebElement)

Example 18 with WebElement

use of org.openqa.selenium.WebElement in project rstudio by rstudio.

the class DialogTestUtils method respondToModalDialog.

public static void respondToModalDialog(WebDriver driver, String response) {
    WebElement dialog = waitForModalToAppear(driver);
    // Find the button requested and invoke it
    List<WebElement> buttons = dialog.findElements(By.className("gwt-Button-DialogAction"));
    for (WebElement button : buttons) {
        if (button.getText().equals(response)) {
            button.click();
            break;
        }
    }
    (new WebDriverWait(driver, 5)).until(ExpectedConditions.stalenessOf(dialog));
}
Also used : WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait) WebElement(org.openqa.selenium.WebElement)

Example 19 with WebElement

use of org.openqa.selenium.WebElement in project java.webdriver by sayems.

the class Action method selectDropdown.

// Method to select value from drop down based on visible text
public void selectDropdown(Supplier<By> by, String value) {
    WebElement locator = driver.findElement(by.get());
    Select dropdown = new Select(locator);
    dropdown.selectByVisibleText(value);
}
Also used : Select(org.openqa.selenium.support.ui.Select) WebElement(org.openqa.selenium.WebElement)

Example 20 with WebElement

use of org.openqa.selenium.WebElement in project rstudio by rstudio.

the class MenuNavigator method findMenuItemByName.

public static WebElement findMenuItemByName(WebElement menuElement, String itemName) {
    List<WebElement> menuItems = menuElement.findElements(By.className("gwt-MenuItem"));
    WebElement foundMenu = null;
    for (WebElement menuItem : menuItems) {
        if (menuItem.getText().startsWith(itemName)) {
            foundMenu = menuItem;
            break;
        }
    }
    assertNotNull(foundMenu);
    return foundMenu;
}
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