WebDriverGenerator { public TargetLocator switchTo() { return new TargetLocator(); } WebDriverGenerator(String value); String get(String value); String close(); String getCurrentUrl(); String getTitle(); String getPageSource(); String getWindowHandles(); String getWindowHandle(); WebElementGenerator findElement(String value); WebElementListGenerator findElements(String value); Options manage(); TargetLocator switchTo(); Navigation navigate();  }
@Test public void checkSwitchToFrameReturnsCorrectCode() { assertThat(driver.switchTo().frame("foobar"), is(equalTo("driver.switchTo().frame(\"foobar\")"))); }
@Test public void checkSwitchToWindowReturnsCorrectCode() { assertThat(driver.switchTo().window("barfoo"), is(equalTo("driver.switchTo().window(\"barfoo\")"))); }
@Test public void checkSwitchToDefaultContentReturnsCorrectCode() { assertThat(driver.switchTo().defaultContent(), is(equalTo("driver.switchTo().defaultContent()"))); }
@Test public void checkSwitchToActiveElementReturnsCorrectCode() { assertThat(driver.switchTo().activeElement(), is(equalTo("driver.switchTo().activeElement()"))); }
@Test public void checkSwitchToAlertAcceptReturnsCorrectCode() { assertThat(driver.switchTo().alert().accept(), is(equalTo("driver.switchTo().alert().accept()"))); }
@Test public void checkSwitchToAlertDismissReturnsCorrectCode() { assertThat(driver.switchTo().alert().dismiss(), is(equalTo("driver.switchTo().alert().dismiss()"))); }
@Test public void checkSwitchToAlertGetTextReturnsCorrectCode() { assertThat(driver.switchTo().alert().getText(), is(equalTo("driver.switchTo().alert().getText()"))); }
@Test public void checkSwitchToAlertSendKeysReturnsCorrectCode() { assertThat(driver.switchTo().alert().sendKeys("bar"), is(equalTo("driver.switchTo().alert().sendKeys(\"bar\")"))); }