Class GrapheneContext
java.lang.Object
org.jboss.arquillian.graphene.context.GrapheneContext
Allows to access current browser instance and configuration.
One needs to know the qualifier of a browser injected via @Drone annotation. The injection point can have qualifier.
If no qualifier is specified, Default qualifier be used.
- Author:
- Jan Papousek
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract GrapheneConfigurationReturns configuration for the contextstatic GrapheneContextgetContextFor(Class<?> qualifier) Get context associated to the given qualifier.abstract Class<?>abstract org.openqa.selenium.WebDrivergetWebDriver(Class<?>... interfaces) If theWebDriverinstance is not available yet, the returned proxy just implementsWebDriverinterface.static GrapheneContextReturns last known context which has been access by a teststatic voidremoveContextFor(Class<?> qualifier) Removes the context associated to the given qualifier.static GrapheneContextsetContextFor(GrapheneConfiguration configuration, org.openqa.selenium.WebDriver driver, Class<?> qualifier) Creates a new context for the given webdriver, configuration and qualifier.
-
Constructor Details
-
GrapheneContext
public GrapheneContext()
-
-
Method Details
-
getQualifier
- Returns:
- qualifier identifying the context.
-
getWebDriver
If theWebDriverinstance is not available yet, the returned proxy just implementsWebDriverinterface. If theWebDriverinstance is available, its class is used to create a proxy, so the proxy extends it.- Parameters:
interfaces- interfaces which should be implemented by the returnedWebDriver- Returns:
- proxy for the
WebDriverheld in the context
-
getConfiguration
Returns configuration for the context -
lastContext
Returns last known context which has been access by a test -
getContextFor
Get context associated to the given qualifier. If theDefaultqualifier is given, the returned context tries to resolves the active context before each method invocation. If the active context is available, the returned context behaves like the active one. -
setContextFor
public static GrapheneContext setContextFor(GrapheneConfiguration configuration, org.openqa.selenium.WebDriver driver, Class<?> qualifier) Creates a new context for the given webdriver, configuration and qualifier. When you create the context, you are responsible to invokeremoveContextFor(java.lang.Class)after the context is no longer valid.- Returns:
- created context
- See Also:
-
removeContextFor
Removes the context associated to the given qualifier.- Parameters:
qualifier-- See Also:
-