Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

StaleElementReferenceError handled poorly in Chrome Accessibility Plugin #2331

@JLLeitschuh

Description

@JLLeitschuh

If the dom changes as the Chrome Accessibility Plugin generates its results then you can get StaleElementReferenceError without any context to tell you where this error came from.

I have spent the past 4 hours debugging this problem and finally have a working solution that at least gives you more useful information than the silent, context lacking failure that is currently returned.

The failure that I was experiencing happened here: https://github.com/angular/protractor/blob/master/plugins/accessibility/index.js#L176

A better way to handle this would be to pass the error back into the failure reporter.

elementPromises.push(
  elem.getOuterHtml().then(function(text) {
    return {
      code: result.rule.code,
      list: trimText(text)
    };
  }, function(reason){
    return {
      code: result.rule.code,
      list: reason
    };
  })

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions