Package org.openqa.selenium.support.ui

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


        return browsers;
    }

    @Test
    public void testWebsocket() throws InterruptedException {
        new Select(getTransportSelect()).selectByVisibleText("WEBSOCKET");
        new Select(getPushModeSelect()).selectByVisibleText("AUTOMATIC");

        assertThat(getStatusText(),
                containsString("fallbackTransport: long-polling"));
        assertThat(getStatusText(), containsString("transport: websocket"));
View Full Code Here


    @Test
    public void testStreaming() throws InterruptedException {
        openDebugLogTab();

        new Select(getTransportSelect()).selectByVisibleText("STREAMING");
        assertThat(getStatusText(),
                containsString("fallbackTransport: long-polling"));
        assertThat(getStatusText(), containsString("transport: streaming"));

        clearDebugMessages();
        new Select(getPushModeSelect()).selectByVisibleText("AUTOMATIC");

        waitForDebugMessage("Push connection established using streaming", 10);
        waitForServerCounterToUpdate();
    }
View Full Code Here

    @Test
    public void testLongPolling() throws InterruptedException {
        openDebugLogTab();

        new Select(getTransportSelect()).selectByVisibleText("LONG_POLLING");
        assertThat(getStatusText(),
                containsString("fallbackTransport: long-polling"));
        assertThat(getStatusText(), containsString("transport: long-polling"));

        clearDebugMessages();
        new Select(getPushModeSelect()).selectByVisibleText("AUTOMATIC");
        waitForDebugMessage("Push connection established using long-polling",
                10);
        waitForServerCounterToUpdate();
    }
View Full Code Here

        return statusLabel.getText();
    }

    protected void disablePush() throws InterruptedException {
        new Select(getPushModeSelect()).selectByVisibleText("DISABLED");

        int counter = getServerCounter();
        sleep(2000);
        assertEquals("Server count changed without push enabled", counter,
                getServerCounter());
View Full Code Here

  /**
   * 返回Select Element,可搭配多种后续的Select操作.
   * eg. s.getSelect(by).selectByValue(value);
   */
  public Select getSelect(By by) {
    return new Select(driver.findElement(by));
  }
View Full Code Here

        updateButton.click();
        header.is().present();
    }

    protected void checkElementIsSelected(ElementBuilder<?> option1) {
        new Select(select).selectByIndex(0);
        IsNotElementBuilder aa;
        option1.is().selected();
        new Select(select).selectByIndex(1);
        option1.is().not().selected();
    }
View Full Code Here

        Graphene.waitModel(browser).until().element(BY_HEADER).is().present();
    }

    @Test
    public void testElementIsSelected() {
        new Select(select).selectByIndex(0);
        Graphene.waitModel().until().element(option1).is().selected();
        new Select(select).selectByIndex(1);
        Graphene.waitModel().until().element(option1).is().not().selected();
    }
View Full Code Here

        Graphene.waitModel().until().element(option1).is().not().selected();
    }

    @Test
    public void testElementIsSelectedWithBy() {
        new Select(select).selectByIndex(0);
        Graphene.waitModel().until().element(BY_OPTION1).is().selected();
        new Select(select).selectByIndex(1);
        Graphene.waitModel().until().element(BY_OPTION1).is().not().selected();
    }
View Full Code Here

        assertTrue("First select should be displayed!", firstSelect.isDisplayed());

        // assertFalse(secondSelect.isDisplayed(), "Second select should be dispayed");

        Graphene.guardAjax(new Select(firstSelect)).selectByVisibleText("Fruits");

        List<String> fruitsActual = new ArrayList<String>();
        List<WebElement> fruitsOptions = new Select(secondSelect).getOptions();
        for (WebElement option : fruitsOptions) {
            fruitsActual.add(option.getText().trim());
        }

        assertTrue("Second select should be dispayed", secondSelect.isDisplayed());

        assertEquals("When selected fruits in first select, in the second " + "should be some examples of Fruits",
            fruitsExpected, fruitsActual);

        Graphene.guardAjax(new Select(firstSelect)).selectByVisibleText("Vegetables");

        List<String> vegetablesActual = new ArrayList<String>();
        List<WebElement> vegetablesOptions = new Select(secondSelect).getOptions();
        for (WebElement option : vegetablesOptions) {
            vegetablesActual.add(option.getText().trim());
        }

        assertEquals("When selected vegetables in first select, in the second " + "should be some examples of vegetables",
View Full Code Here

        assertEquals("The ouput string should be empty!", "", page.getOutput().getText().trim());
    }

    @Test
    public void testLogAndClear() {
        Select select = new Select(page.getSeveritySelect());
        select.selectByIndex(LogPage.Severity.INFO.getIndex());
        page.getSubmit().click();
        Graphene
            .waitAjax()
            .until(
                "After setting severity to <info> and submitting, the logging area should contain a message with severity <info>.")
View Full Code Here

TOP

Related Classes of org.openqa.selenium.support.ui.Select

Copyright © 2018 www.massapicom. 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.