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();
}
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);
}
});
}
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));
}
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);
}
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;
}
Aggregations