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
Post a Comment