Javascript – Do stuff according to whether an element exists or not
I want to know whether an element exists or not and do stuff according to that. I tried many options but failed. For example: cy.get(deleteCellButtonLocator).then(($el) => { if ($el.length > 0) { //found cy.log(cellName + ' exists. Deleting...'); } else…