JBoss Community Archive (Read Only)

Graphene 2

Using Drone

Graphene integrates with Arquillian Drone to simplify process of instantiation of browser session.
So Drone takes care of WebDriver instance creation and configuration and then it delegates this session to Graphene.

Configuration

Graphene shares the configuration with Drone WebDriver, so you can refer to Drone.

In general, configuration is driven by arquillian.xml and can be overriden by System properties.

Browser Instantiation

You can ask Drone to instantiate any specific implementation of WebDriver like FirefoxDriver, ChromeDriver or HtmlUnitDriver, e.g.:

@Drone
FirefoxDriver browser;

But it is recommended to use WebDriver interface and use arquillian.xml to choose appropriate browser instance:

@Drone
WebDriver browser;
 <arquillian xmlns="http://jboss.com/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

    <extension qualifier="webdriver">
        <property name="browser">firefox</property>
    </extension>

</arquillian>

For more configuration options, refer to Drone and browser driver implementations.

Drone Reusable Session

In order to speed up development, Drone comes with Reusable Remote WebDriver Session feature.

This feature make sure that Drone does not close the browser session on the end of each test,
and it stores the session handle in the pernament storage.

Thus after running first test, browser session is still open and next tests can reuse it.

Speed Up Development

Since browser session does not have to be opened repeatedly, Drone saves this time
and repeating a test leads into huge time savings.

This enables browser automated tests development as close to unit tests execution time as possible.

Improved Browser Debugging

Since session is not closed at the end of test, you can tweak anything in browser setup you want including setup of browser debuggers (Firebug, Chrome Dev Tools).

You can for example:

  • open debugger and watch network usage

  • insert breakpoints to scripts

  • watch browser console

Note: it is tempting to use this feature also to speed up test execution - this is not recommended, since then tests can influence each other.

Using Selenium Server

This feature is available only when using remote WebDriver session. So you need to download appropriate version of Selenium Server and start the server:

java -jar selenium-server-standalone-2.35.0.jar

Now Drone can connect to this server and share the session-id across several tests.

Turn on Reusable Browser Session session

You can turn on Reusable Browser Session by following entry:

<arquillian xmlns="http://jboss.com/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

    <extension qualifier="webdriver">
        <property name="remoteReusable">true</property>
        <property name="remoteAddress">http://localhost:4444/wd/hub/</property>
    </extension>

</arquillian>
JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-10 12:14:27 UTC, last content change 2013-09-11 09:33:23 UTC.