1 Reply Latest reply on Aug 21, 2014 1:00 PM by lfryc

    Drone/Graphene - interupt waitModel() on client error

    steve_b

      Hi all,

       

      I'm having a hard time getting a more meaningful error reporting for our graphene/drone based UI-tests: We often have the case that tests fail due to some javascript errors or resource errors (we are using AngularJS and PhantomJS).

       

      Currently I know when a javascript error occurs and I can log it to disc or do a phantom.exit(-1) and handle it using something like this

       

      var page = this;
      phantom.onError = function() {
          page.render('dump.png');
          phantom.exit(-1);
      };
      

      This script is evaluated using phantomJSDriver.executePhantomJS. With a EventFiringWebDriver it will trigger onException(java.lang.Throwable throwable, WebDriver driver).

       

      My problem is: I cannot cancel the pending waits, like waitModel().until(...)...so the final error will be "org.openqa.selenium.TimeoutException: Timed out after..."

       

      I know what the error is on the client side (javascript) but I cannot figure out a clean and stable way to handle this on the arquillian side. Calling phantom.exit(-1) also causes an infinite wait on the arquillian side (waiting for the socket read).