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.

Calling cssContainingText to search for subelements results in "Invalid locator" error #948

@PaddyMann

Description

@PaddyMann

#52 discusses chaining findElement to find child elements.

As discussed in that issue, I can see that this works:

 ptor.findElement(protractor.By.tagName('tbody')).findElements(protractor.By.tagName('tr')).then(function(rows){
    expect(rows.length).toBe(10);
});

It also works to call protractor.By.cssContainingText in place of the first locator.

But if I change it to:

 ptor.findElement(protractor.By.tagName('tbody')).findElements(protractor.By.cssContainingText('tr','my text')).then(function(rows){
    expect(rows.length).toBe(10);
});

then I get "TypeError: Invalid locator".

Is this expected behaviour? Would be great to be able to use cssContainingText in this way.

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