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(){...
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));
}
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);'