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.

Cannot read property 'indexOf' of null error :Expected condition textToBePresentInElementValue  #5389

@praveendvd

Description

@praveendvd

If user tries to access an element that does not have the attribute 'value' then the EC.textToBePresentInElementValue throws Cannot read property 'indexOf' of null error :

let EC = protractor.ExpectedConditions;
describe('Test', function () {
   it('test {Regression} {Sanity} {Sanity}', async function () {
      await browser.get("http://juliemr.github.io/protractor-demo/")
      let resultElement=element(by.xpath('//h2'))
      await browser.wait(EC.textToBePresentInElementValue(resultElement, 'Z'), 5000,"this is first 1");
    });
   });

Expected:

Script should wait till value attribute is present and contains in the text. If not, it should time out with customised message "this is first 1",

Protractor version: Version 5.4.2
Node: v10.16.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions