Examples of WebDriverWait


Examples of org.openqa.selenium.support.ui.WebDriverWait

   // Unfortunately even after the dialog is loaded, the textbox into which
   // we need to type may not yet be ready for input. Wait for it to be
   // present and focused before continuing.
   public static void waitForFocusedInput(final WebDriver driver,
                                          final WebElement dialog) {
      (new WebDriverWait(driver, 5)).until(new ExpectedCondition<Boolean>() {
          public Boolean apply(WebDriver d) {
             List<WebElement>elements = dialog.findElements(By.tagName(
                   "input"));
             if (elements.size() > 0 &&
                 driver.switchTo().activeElement().equals(elements.get(0))) {
View Full Code Here

Examples of org.openqa.selenium.support.ui.WebDriverWait

{
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
      driver_ = RStudioWebAppDriver.start();

      (new WebDriverWait(driver_, 10))
        .until(ExpectedConditions.presenceOfElementLocated(
              By.className("gwt-MenuBar")));
   }
View Full Code Here

Examples of org.openqa.selenium.support.ui.WebDriverWait

      WebElement findMenuEntry = MenuNavigator.getMenuItem(driver_,
            "Edit", "Find...");
      findMenuEntry.click();
     
      // Wait for the find and replace panel to come up
      (new WebDriverWait(driver_, 2))
        .until(ExpectedConditions.presenceOfElementLocated(
              By.id(ElementIds.getElementId(ElementIds.FIND_REPLACE_BAR))));
     
      // Type the text and the text to be replaced (replace 'bar' with 'foo')
      Actions rep = new Actions(driver_);
View Full Code Here

Examples of org.openqa.selenium.support.ui.WebDriverWait

      WebElement newRScriptMenuEntry = MenuNavigator.getMenuItem(driver_,
            "File", "New File", "R Script");
      newRScriptMenuEntry.click();
     
      // Wait for the "Untitled" buffer to appear
      (new WebDriverWait(driver_, 5)).until(new ExpectedCondition<Boolean>() {
         public Boolean apply(WebDriver d) {
            List<WebElement>elements = driver_.findElements(By.className(
                   "gwt-TabLayoutPanelTab-selected"));
            for (WebElement e: elements) {
               if (e.getText().startsWith("Untitled")) {
View Full Code Here

Examples of org.openqa.selenium.support.ui.WebDriverWait

       popup.sendKeys(Keys.ESCAPE);
       popup.sendKeys("print");
       popup.sendKeys(Keys.TAB);
       popup.perform();
      
       (new WebDriverWait(driver_, 5)).until(new ExpectedCondition<Boolean>() {
          public Boolean apply(WebDriver d) {
             List<WebElement>elements = driver_.findElements(By.id(
                   ElementIds.getElementId(ElementIds.POPUP_COMPLETIONS)));
             return elements.size() > 0;
          }
       });

       // Test cancelling autocomplete once invoked
       Actions close = new Actions(driver_);
       close.sendKeys(Keys.ESCAPE).perform();

       (new WebDriverWait(driver_, 5)).until(new ExpectedCondition<Boolean>() {
          public Boolean apply(WebDriver d) {
             List<WebElement>elements = driver_.findElements(By.id(
                   ElementIds.getElementId(ElementIds.POPUP_COMPLETIONS)));
             return elements.size() == 0;
          }
View Full Code Here

Examples of org.openqa.selenium.support.ui.WebDriverWait

      Actions plotCars = new Actions(driver_);
      plotCars.sendKeys(Keys.ESCAPE + "plot(cars)" + Keys.ENTER);
      plotCars.perform();
     
      // Wait for the Plot window to activate
      final WebElement plotWindow = (new WebDriverWait(driver_, 5))
        .until(ExpectedConditions.presenceOfElementLocated(
              By.id(ElementIds.getElementId(ElementIds.PLOT_IMAGE_FRAME))));
     
      // Wait for a plot to appear in the window
      Assert.assertEquals(plotWindow.getTagName(), "iframe");
      driver_.switchTo().frame(plotWindow);

      (new WebDriverWait(driver_, 5))
        .until(ExpectedConditions.presenceOfElementLocated(By.tagName("img")));
     
      // Switch back to document context
      driver_.switchTo().defaultContent();
   }
View Full Code Here

Examples of org.openqa.selenium.support.ui.WebDriverWait

      Actions help = new Actions(driver_);
      help.sendKeys(Keys.ESCAPE + "?lapply" + Keys.ENTER);
      help.perform();

      // Wait for the Help window to activate
      final WebElement helpWindow = (new WebDriverWait(driver_, 5))
        .until(ExpectedConditions.presenceOfElementLocated(
              By.id(ElementIds.getElementId(ElementIds.HELP_FRAME))));

      // Wait for help to appear in the window
      Assert.assertEquals(helpWindow.getTagName(), "iframe");
      driver_.switchTo().frame(helpWindow);
     
      (new WebDriverWait(driver_, 5))
        .until(ExpectedConditions.textToBePresentInElement(
              By.tagName("body"), "lapply"));
     
      // Switch back to document context
      driver_.switchTo().defaultContent();
View Full Code Here

Examples of org.openqa.selenium.support.ui.WebDriverWait

{
   @BeforeClass
   public static void setUpBeforeClass() throws Exception {
      driver_ = RStudioWebAppDriver.start();

      (new WebDriverWait(driver_, 10))
        .until(ExpectedConditions.presenceOfElementLocated(
              By.className("gwt-MenuBar")));
   }
View Full Code Here

Examples of org.openqa.selenium.support.ui.WebDriverWait

      typeName.perform();
      DialogTestUtils.respondToModalDialog(driver_, "Open");
     
      // After a moment the modal prompting for the path will disappear, and
      // the modal prompting for input will appear.
      (new WebDriverWait(driver_, 5)).until(new ExpectedCondition<Boolean>() {
          public Boolean apply(WebDriver d) {
             List<WebElement>elements = driver_.findElements(By.className(
                   "gwt-DialogBox-ModalDialog"));
             if (elements.size() > 0) {
                if (elements.get(0).getText().contains("Import Dataset")) {
View Full Code Here

Examples of org.openqa.selenium.support.ui.WebDriverWait

public class ConsoleTestUtils
{
   public static void beginConsoleInteraction(final WebDriver driver) {
       // Wait for the console panel to load
      (new WebDriverWait(driver, 15)).until(new ExpectedCondition<Boolean>() {
         public Boolean apply(WebDriver d) {
            List<WebElement>elements = driver.findElements(By.id(
                  ElementIds.getElementId(ElementIds.CONSOLE_INPUT)));
            return elements.size() > 0;
         }
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.