user3654435
user3654435

Reputation: 87

AssertionError: expected false to equal true

Here is the code:

this.Then(/^I click to the next button on the edit page$/,function(callback) {
    targetPO.getEditNextButton().isPresent().then(function(){
        targetPO.getEditNextButton().click().then(callback);
    });
})

I got the:

AssertionError: expected false to equal true

error. I can not find any useful tutorial, only saint tales.

What is the reason for the error?

Here is the getEditNextButton() function:

function getEditNextButton() {
    return element(by.id(selectors.editNextButton));
}

Upvotes: 1

Views: 11544

Answers (1)

arpitjain2402
arpitjain2402

Reputation: 130

Looks like an issue with the way you are calling the function. It can be solved in two ways:
1) Either from function getEditNextButton(), you remove 'element' in the return element(by.id(selectors.editNextButton));

or

2) Since, by calling getEditNextButton() function, you are returning 'element(by.id(...)' .
So, You should remove element. from 'element.getEditNextButton().click().then(callback);'

Upvotes: 1

Related Questions