use of com.seleniumtests.uipage.htmlelements.FrameElement in project seleniumRobot by bhecquet.
the class TestFrameElement method testUseElementInsideFrameRetryOnError.
@Test(groups = { "ut" })
public void testUseElementInsideFrameRetryOnError() throws Exception {
FrameElement frame = new FrameElement("", By.id("frameId"));
HtmlElement el = new HtmlElement("", By.id("el"), frame);
Mockito.doThrow(new WebDriverException("fake exception")).doNothing().when(element).click();
el.click();
// 2 invocations because first call to click raises an error
verify(locator, times(2)).frame(any(WebElement.class));
verify(locator, times(2)).defaultContent();
}
use of com.seleniumtests.uipage.htmlelements.FrameElement in project seleniumRobot by bhecquet.
the class TestFrameElement method testCheckBoxElementInsideFrame.
@Test(groups = { "ut" })
public void testCheckBoxElementInsideFrame() throws Exception {
FrameElement frame = new FrameElement("", By.id("frameId"));
CheckBoxElement el = new CheckBoxElement("", By.id("el"), frame);
el.check();
verify(locator, times(2)).frame(any(WebElement.class));
verify(locator, times(2)).defaultContent();
}
use of com.seleniumtests.uipage.htmlelements.FrameElement in project seleniumRobot by bhecquet.
the class TestFrameElement method testRadioButtonElementInsideFrame.
@Test(groups = { "ut" })
public void testRadioButtonElementInsideFrame() throws Exception {
FrameElement frame = new FrameElement("", By.id("frameId"));
RadioButtonElement el = new RadioButtonElement("", By.id("el"), frame);
el.check();
verify(locator).frame(any(WebElement.class));
verify(locator).defaultContent();
}
use of com.seleniumtests.uipage.htmlelements.FrameElement in project seleniumRobot by bhecquet.
the class TestFrameElement method testUseElementInsideFrameWithIndex.
/**
* issue #276: Check that we can switch to a frame by index
* @throws Exception
*/
@Test(groups = { "ut" })
public void testUseElementInsideFrameWithIndex() throws Exception {
ArgumentCaptor<WebElement> frameArgument = ArgumentCaptor.forClass(WebElement.class);
FrameElement frame = new FrameElement("", By.tagName("iframe"), 1);
HtmlElement el = new HtmlElement("", By.id("el"), frame);
el.click();
verify(locator).frame(frameArgument.capture());
Assert.assertEquals(frameArgument.getValue().getText(), "222");
verify(locator).defaultContent();
}
use of com.seleniumtests.uipage.htmlelements.FrameElement in project seleniumRobot by bhecquet.
the class TestFrameElement method testSelectListInsideFrame.
@Test(groups = { "ut" })
public void testSelectListInsideFrame() throws Exception {
when(element.getTagName()).thenReturn("select");
FrameElement frame = new FrameElement("", By.id("frameId"));
SelectList el = new SelectList("", By.id("el"), frame);
el.getSelectedText();
verify(locator).frame(any(WebElement.class));
verify(locator, times(1)).defaultContent();
}
Aggregations