How can I check if a button exists on a web page, and if exists click on it.
if the button does not exist i get an error message
---------------------------
Error: TypeError: Cannot read property 'click' of undefined
---------------------------
Execute this code only if the button is present.
Code: Select all
PageInst.Evaluate("document.getElementsByClassName('btn-block')[0].click()")