@Retention(value=RUNTIME) @Target(value=TYPE) @Repeatable(value=Frames.class) public @interface Frame
PageObject implementations to specify the iframe parent of all elements
described by the page.
In this example, the whole FramedPage class is marked with this annotation. Every element on this page are
in an iframe which has "my-frame" as id. The search for the button field is
performed inside of the iframe element.
@Frame(using="#my-frame")
public void FramedPage extends PageObject {
@Find(using="#button")
private WebElement button;
}
It is possible to add multiple Frame annotations to a class. This is useful when we have frames including frames
and we want to access the content of the inner frame. In this case we have to list all frames ending with target frame, each frame should
have it's own annotation. For example, if our HTML document contains a frame with "parent-frame" id, and we load a HTML page into this
frame which also contains a frame, with "child-frame" id, then we can access the content of the second frame with these annotations:
@Frame(using="#parent-frame")
@Frame(using="#child-frame")
public void ChildFramedPage extends PageObject {
...
}
public abstract By by
By.CSS_SELECTOR.Created by Kornél Simon, 2022