I am having trouble locating a specific element in Protractor while using Protractor + Jasmine + POM. Interestingly, I can find the element with count 1 in the developer console.
Despite adding a try and catch block for element location, it always ends up in the catch block.
//let erasertype = element(by.xpath("//a[@data-tool='Eraser']"));
let erasertype = element(By.xpath("//a[@data-tooloption='eraser']"));
this.selecterasertype = async () => {
try {
await erasertype.click();
}
catch (err) {
console.log("Unable to select erasertype");
}