I'm making a function to return a boolean to know if an element is present or not, but I get
this is the status: false
How can I get an only true or false response, please help, I'm using an if condition but it shows that response...
async IsPresent(element){
try{
await element.isPresent().then(function(status){
console.log("this is the status: " + status);
return status;
});
}
catch(err){
return console.log(err);
}
};
this is the function where I'm calling IsPresent
async ClickSomething(){
try{
await this.helpers.ClickElement(oneElement);
if(await this.helpers.IsPresent(anotherElement) == false){
//Do something
}else{
//Do something esle
}
catch(err){
return console.log(err);
}
};