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));
}
3

1 Answer

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);'

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like