Selenium-Remote-Driver icon indicating copy to clipboard operation
Selenium-Remote-Driver copied to clipboard

Add testing methods like find_element_by_xpath_ok()

Open bschmalhofer opened this issue 4 years ago • 3 comments

My understanding is the S::R::D::find_element() throws an exception when the element is not found. Consequently the methods T::S::R:D::find_element_ok() and T::S::R::D::find_no_element_ok() throw an exception when the assertion is not valid.

For Selenium::Remote::Driver there is the workaround to use the methods like 'find_element_by_()' if one does not want the exception. Would it make sense to add testing methode find_element_ok_by_*()and 'find_no_element_by_()' for Test::Selenium::Remote::Driver ? This approach should be gently on existing code.

bschmalhofer avatar Apr 11 '21 14:04 bschmalhofer

seems like a good idea to me. I would say that we should return undefined and ensure $@ is set appropriately in these cases.

I probably won't get time to write a patch until later this week.

teodesian avatar Apr 11 '21 22:04 teodesian

Nice, looks like you have a PR for this one.

I'll look at it tomorrow.

teodesian avatar Apr 11 '21 22:04 teodesian

disregard prior comment, pr unrelated.

teodesian avatar Apr 12 '21 20:04 teodesian