An example of expected output in a full exception message:
seleniumbase.common.exceptions.NoSuchElementException:
Element {div#ARMY_OF_ROBOTS} was not present after 1 second!
Expected output from pdbp Debug Mode:
[1] > /Users/michael/github/SeleniumBase/examples/test_fail.py(16)
..
12 @pytest.mark.expected_failure
13 def test_find_army_of_robots_on_xkcd_desert_island(self):
14 self.open("https://xkcd.com/731/")
15 print("\n(This test should fail)")
16 -> self.assert_element("div#ARMY_OF_ROBOTS", timeout=1)
seleniumbase.common.exceptions.NoSuchElementException:
Element {div#ARMY_OF_ROBOTS} was not present after 1 second!
(Pdb+)
Include the module name in the exception, except with
builtins
Eg.
KeyError
is reallybuiltins.KeyError
, but since it is part ofbuiltins
, thebuiltins
part isn't necessary.But in the case of
NoSuchElementException
, show the fullselenium.common.exceptions.NoSuchElementException
.This can help reduce confusion, especially when different libraries have the same exception name:
Eg.
An example of expected output in a full exception message:
Expected output from
pdbp
Debug Mode: