我正在使用,和来Arquillian 1.1.6.Final
测试。它工作得很好,给了我一个预期的结果。JSF
Arquillian Drone 2.0.0.Alpha3
Arquillian Graphene 2.1.0.Alpha2
Arquillian Browser Screenshooter 2.1.0.Alpha2
screen shot
Arquillian Drone
当我使用org.jboss.arquillian.drone.api.annotation.Qualifier
as时有一些麻烦
java.lang.IllegalStateException: There is no context available for qualifier org.jboss.arquillian.drone.api.annotation.Default.
Available contexts are [interface test.com.scc.aspg.demo.arq.simple.MyExtraBrowser].
at org.jboss.arquillian.graphene.context.GrapheneContextImpl$LazyContext.getContext(GrapheneContextImpl.java:302)
at org.jboss.arquillian.graphene.context.GrapheneContextImpl$LazyContext$1.getTarget(GrapheneContextImpl.java:311)
at org.jboss.arquillian.graphene.proxy.GrapheneProxyHandler.getTarget(GrapheneProxyHandler.java:149)
at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler.invoke(GrapheneContextualHandler.java:118)
at com.sun.proxy.$Proxy336.unwrap(Unknown Source)
at org.arquillian.extension.recorder.screenshooter.browser.impl.BrowserScreenshooter.getTakingScreenshotsBrowser(BrowserScreenshooter.java:158)
我的代码如下: -
import org.jboss.arquillian.drone.api.annotation.Qualifier;
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.FIELD, ElementType.PARAMETER })
@Qualifier
public @interface MyExtraBrowser {
}
@RunWith(Arquillian.class)
public class DroneTest {
@Drone
@MyExtraBrowser //<---This works without Arquillian Browser Screenshooter
private WebDriver browser;
@Test
@RunAsClient
public void ensureIndexPage() {
try{
browser.get("http://www.google.com")
} catch (Exception e){
e.printStackTrace();
}
}
}
你能帮忙提供进一步的建议吗?