Search in sources :

Example 1 with Table

use of com.seleniumtests.uipage.htmlelements.Table in project seleniumRobot by bhecquet.

the class TestFrameElement method testTableOutsideFrame.

@Test(groups = { "ut" })
public void testTableOutsideFrame() throws Exception {
    Table el = new Table("", By.id("el"));
    el.getColumns();
    verify(locator, times(0)).frame(any(WebElement.class));
}
Also used : Table(com.seleniumtests.uipage.htmlelements.Table) WebElement(org.openqa.selenium.WebElement) RemoteWebElement(org.openqa.selenium.remote.RemoteWebElement) Test(org.testng.annotations.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) MockitoTest(com.seleniumtests.MockitoTest)

Example 2 with Table

use of com.seleniumtests.uipage.htmlelements.Table in project seleniumRobot by bhecquet.

the class TestFrameElement method testTableInsideFrame.

@Test(groups = { "ut" })
public void testTableInsideFrame() throws Exception {
    FrameElement frame = new FrameElement("", By.id("frameId"));
    Table el = new Table("", By.id("el"), frame);
    el.getColumns();
    // issue #320: as we return HtmlElement instead of WebElement, we need to search for root element (the table) each time we search for columns and cells
    verify(locator, times(3)).frame(any(WebElement.class));
    verify(locator, times(3)).defaultContent();
}
Also used : Table(com.seleniumtests.uipage.htmlelements.Table) FrameElement(com.seleniumtests.uipage.htmlelements.FrameElement) WebElement(org.openqa.selenium.WebElement) RemoteWebElement(org.openqa.selenium.remote.RemoteWebElement) Test(org.testng.annotations.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) MockitoTest(com.seleniumtests.MockitoTest)

Aggregations

MockitoTest (com.seleniumtests.MockitoTest)2 Table (com.seleniumtests.uipage.htmlelements.Table)2 WebElement (org.openqa.selenium.WebElement)2 RemoteWebElement (org.openqa.selenium.remote.RemoteWebElement)2 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)2 Test (org.testng.annotations.Test)2 FrameElement (com.seleniumtests.uipage.htmlelements.FrameElement)1