Example usage for org.openqa.selenium.firefox FirefoxDriver getCapabilities

List of usage examples for org.openqa.selenium.firefox FirefoxDriver getCapabilities

Introduction

In this page you can find the example usage for org.openqa.selenium.firefox FirefoxDriver getCapabilities.

Prototype

@Override
    public Capabilities getCapabilities() 

Source Link

Usage

From source file:com.vaadin.testbench.TestBenchDriverTest.java

@Test
public void testDisableWaitForVaadin() {
    Capabilities mockCapabilities = createNiceMock(Capabilities.class);
    expect(mockCapabilities.getBrowserName()).andReturn("firefox").anyTimes();

    FirefoxDriver mockFF = createMock(FirefoxDriver.class);
    expect(mockFF.getCapabilities()).andReturn(mockCapabilities).anyTimes();
    expect(mockFF.executeScript(contains("clients[client].isActive()"))).andReturn(true).once();
    WebElement mockElement = createNiceMock(WebElement.class);
    expect(mockFF.findElement(isA(By.class))).andReturn(mockElement).times(2);
    replay(mockFF, mockElement, mockCapabilities);

    TestBenchDriverProxy tb = (TestBenchDriverProxy) TestBench.createDriver(mockFF);
    tb.disableWaitForVaadin();//w w w .  j a  v  a2s  .  c  o  m
    WebElement testBenchElement = tb.findElement(By.id("foo"));

    tb.enableWaitForVaadin();
    testBenchElement = tb.findElement(By.id("foo"));

    verify(mockFF, mockElement);
}