Search in sources :

Example 1 with LinkElement

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

the class TestFrameElement method testLinkElementInsideFrame.

@Test(groups = { "ut" })
public void testLinkElementInsideFrame() throws Exception {
    FrameElement frame = new FrameElement("", By.id("frameId"));
    LinkElement el = new LinkElement("", By.id("el"), frame);
    el.click();
    verify(locator).frame(any(WebElement.class));
    verify(locator).defaultContent();
}
Also used : LinkElement(com.seleniumtests.uipage.htmlelements.LinkElement) 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)

Example 2 with LinkElement

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

the class TestFrameElement method testUseElementInsideElementInsideFrame.

/**
 * Test that we enter the iframe of the parent element when searching looking a sub-element
 * @throws Exception
 */
@Test(groups = { "ut" })
public void testUseElementInsideElementInsideFrame() throws Exception {
    FrameElement frame = new FrameElement("", By.id("frameId"));
    HtmlElement el = new HtmlElement("", By.id("el"), frame);
    LinkElement link = el.findLinkElement(By.id("link"));
    link.click();
    verify(locator).frame(any(WebElement.class));
    verify(locator).defaultContent();
}
Also used : HtmlElement(com.seleniumtests.uipage.htmlelements.HtmlElement) LinkElement(com.seleniumtests.uipage.htmlelements.LinkElement) 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)

Example 3 with LinkElement

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

the class TestFrameElement method testLinkElementOutsideFrame.

@Test(groups = { "ut" })
public void testLinkElementOutsideFrame() throws Exception {
    LinkElement el = new LinkElement("", By.id("el"));
    el.click();
    verify(locator, times(0)).frame(any(WebElement.class));
}
Also used : LinkElement(com.seleniumtests.uipage.htmlelements.LinkElement) 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)3 LinkElement (com.seleniumtests.uipage.htmlelements.LinkElement)3 WebElement (org.openqa.selenium.WebElement)3 RemoteWebElement (org.openqa.selenium.remote.RemoteWebElement)3 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)3 Test (org.testng.annotations.Test)3 FrameElement (com.seleniumtests.uipage.htmlelements.FrameElement)2 HtmlElement (com.seleniumtests.uipage.htmlelements.HtmlElement)1