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.

element ... .getAttribute(...) returning Objects unexpectedly #673

@geppy

Description

@geppy

I'm collecting all of the anchor tags on a page with the intent of checking to ensure that they aren't dead links... but I'm unexpectedly finding that I'm unable to get valid HREF values for half of them.

element.all(by.css('a')).each(function (element) {
    var linkTarget = element.getAttribute('href');
    expect(typeof linkTarget).toBe("string");
});

If I run code in the browser on the same site, I find that all of my anchor tags have an href of type "string". Am I using the API incorrectly? I'm using Protractor on a non-Angular page: does this functionality depend on Angular?

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