JBoss Community Archive (Read Only)

Graphene 2

Dependency Injection

Following objects can be injected using @ArquillianResource annotation to:

For example:

@RunWith(Arquillian.class)
@RunAsClient
public class MyTest {

    @Drone
    private WebDriver browser;


    @ArquillianResource
    private JavascriptExecutor executor;


    @Test
    public void test() {
       browser.navigate().to(...);
       executor.executeAsync(...);
    }
}

Here is a list of available resources that can be injected:

Class

Purpose

WebDriver

The main interface to use for testing, which represents an idealised web browser.

LocalStorage

Represents the local storage for the site currently opened in the browser. Each site has its own separate storage area.

SessionStorage

Represents the session storage in the browser for the site currently opened in the browser. The session storage areas is specific to the current top level browsing context. Each context has a unique set of session storage, one for each origin. Sites can add data to the session storage and it will be accessible to any page from the same site opened in that window.

ApplicationCache

Represents the application cache status.

TouchScreen

Represents basic touch screen operations.

Rotatable

Represents rotation of the browser view for orientation-sensitive devices. When using this with a real device, the device should not be moved so that the built-in sensors do not interfere.

BrowserConnection

Represents the connection state of the application.

LocationContext

Represents the physical location of the browser.

Actions

The user-facing API for emulating complex user gestures. Use this class rather than using the Keyboard or Mouse directly. Implements the builder pattern: Builds a CompositeAction containing all actions specified by the method calls.

Keyboard

Represents  basic keyboard operations.

Mouse

Represents  basic mouse operations.

JavascriptExecutor

Executes JavaScript, providing access to the mechanism to do so.

TakesScreenshot

Captures a screenshot and store it in different ways.

Capabilities

Describes a series of key/value pairs that encapsulate aspects of a browser.

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