JBoss Community Archive (Read Only)

Graphene 2

InFrame annotation

To facilitate the tedious process of switching to and from a particular frame/iframe; you can now just use the @InFrame annotation to specify in which frame the element should be located. The details are handled by Graphene.

Usage

@Page
@InFrame(index = 0)
private PageObject page;

@FindBy(id = "foo-bar")
@InFrame(nameOrId = "second")
private PageFragment myFragment;

@FindBy(tagName = "div")
@InFrame(index = 1)
private WebElement plainWebElement;

You can determine the iframe/frame by its index (zero based), or by nameOrId strategy. Graphene will automatically switch to a particular iframe/frame when a method is invoked on such annotated field.

When using @InFrame together with Page Object, all elements declared in such Page Object will be treated as they are annotated with the same @InFrame.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-10 12:14:40 UTC, last content change 2014-07-22 09:08:08 UTC.