3

i am reading the tutorial on Arquillian's website http://arquillian.org/guides/functional_testing_using_drone/

Under the paragraph of "Enabling Client Mode" they state that it is possible to mix in-container and client modes in the same test! Just leave off the testable attribute. Any method annotated with @RunAsClient will execute from the client, the remainder will execute inside the container, giving you the best of both worlds!

Here is my Issue. I want to write a test that users

@Drone
DefaultSelenium browser and

@EJB
MyXXXRepository

I have one test that will add a user to the InMemory database before i have a Selenium test which logs in on the browser with that user...

So in order to get Selenium to work i need to tell the @Deployment to be testable=false, this will cause my @EJB to fail. So according to the documentation i can skip the testable=false, if i tell the Selenium Test Method that it should run in Client Mode. According to the documentation this should work. But!!! This will throw an Exception

Caused by: java.lang.NoClassDefFoundError: Lcom/thoughtworks/selenium/DefaultSelenium;

So i need to be able to tell the

@Drone
DefaultSelenium browser;

To be in Client Mode as well...

Any takers?

Petr Mensik
  • 26,874
  • 17
  • 90
  • 115

2 Answers2

0

Drone is intended to be client side. Personally I've never tried to deploy WebDriver/Drone tests and run it from the server. This sounds a bit crazy :) And obviously since the test itself is mixed classloader complains about the Drone-related imports.

But I have a solution for you which lets you test from the "grey-box" perspective. There is a fairly new extension in Arquillian universe called Warp which allows you to solve your very problem. Here's the guide.

Hope that helps.

bartosz.majsak
  • 1,054
  • 9
  • 13
0

I solved the problem by using an import script that will import the user prior to the test, this way i do not need to instantiate the repository and it is now a clean client side test.