1 Reply Latest reply on Jun 4, 2014 9:53 AM by Juraj Húska

    problems with Graphene guards

    Davide Gesino Newbie

      I'm having had times trying to using the arquillian extensions drone and graphene.

      I use Arquillian 1.1.3 final, drone 1.3.0.Final and graphene 2.0.2.Final, but I rely on Selenium 2.41 (added top selenium BOM before arquillian dependencies), and test against Firefox 27.

      The app I'm testing is highly dynamic, as it has been developed using backbone.js, thus all the HTML components I interact with are guarded by"isPresent", "isVisible".


      The point is, on my machine all my tests work fine, but as I move to a faster machine the tests fail randomly, though I have added all the required guards.

      To do so I use an utility function that relies on Graphene guards.


        private static void waitForElementToBePresent(By sel,SearchContext ctx) {


                              .withTimeout(40, TimeUnit.SECONDS)

                              .pollingEvery(2, TimeUnit.SECONDS)






        private static void waitForElementToBeVisible(By sel,SearchContext ctx) {


                              .withTimeout(40, TimeUnit.SECONDS)

                              .pollingEvery(2, TimeUnit.SECONDS)







      I don't use Grahpene page injection feature.

      My tests al look like this:




      WebDriver browser;


      public void myTest(){





                      final WebElement body = browser.findElement(ByJQuery.selector("body"));





                       * selecting the following jquery expression with all the required guards

                       * $(".ebAccordion:first").find(".ebAccordion").eq(0).find(".ebCheckbox:first")



                      WebElement firstLevelAccordion =body.findElement(ByJQuery.selector(".ebAccordion:first"));



                      WebElement secondLevelAccordion = firstLevelAccordion.findElement(ByJQuery.selector(".ebAccordion:first"));



                      WebElement cardCheckBox  = secondLevelAccordion.findElement(ByJQuery.selector(".ebCheckbox:first"));




      In every test I navigate to a different page, then I calculate from scratch all the elements I need to interact with, starting from the browser.


      Am I using drone+graphene in a wrong way, or there are still issues on Graphene guards?

      THe workaround is to add plenty of sleep after every interaction with a WebElement (click and so on), but I would like to go with a different way if possible.


      Thanks a lot