perl - How to check if Selenium's find_element did find it? -


i'm using perl's selenium::remote::driver module (or selenium::chrome), , in code, have find first element has class="myclass" :

my $elem = $selenium->find_element("myclass","class"); 

how know if driver did find it, or if didn't (because there no such class in page)?

in both cases (element found or not), seem getting selenium::remote::webelement object back. if ->click (even in eval block), whole script dies

"an element not located on page using given search parameters: myclass,class name @ ...".

how can catch error?


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -