I'm trying to write Robot Framework tests to cover certain use cases for a third party AngularJS app.

I have the requirement that I need to use Python 3.5+ and SeleniumLibrary (rather than the old Selenium2Library).

I've attempted to adapt the wait\_until\_angular\_ready keyword from <https://github.com/rickypc/robotframework-extendedselenium2library> to work outside of the context of this library, updating it to work with Python 3.5+ and SeleniumLibrary.

The keyword executes the following JavaScript to check when Angular is Ready, but it seems to always return true immediately

```
var cb = arguments[arguments.length-1];
if(window.angular){
  var $inj;
  try {
    $inj = angular.element(document.querySelector('[data-ng-app],[ng-app],.ng-scope')
      ||document).injector()
      ||angular.injector(['ng'])
  } catch(ex) {
    $inj = angular.injector(['ng'])
  };
  $inj.get = $inj.get||$inj;
  $inj.get('$browser').notifyWhenNoOutstandingRequests(function() {
    cb(true) // it's always returning here
  })
} else {
  cb(true)
}

```

This is called from within my version of the wait\_until\_angular\_ready keyword which is located in a class which subclasses the SeleniumLibrary WaitingKeywords class.

The code which executes the Js looks like

```
WebDriverWait(self.driver, 100, 0.1). \
  until(lambda driver: driver.execute_async_script(script), error)

```

Have I made a mistake here or is this not the correct way to check when angular has finished rendering the page? I will admit that I am not very familiar with AngularJS