In this chapter, we will have a look at some of the more common exceptions that you may see when working with Selenium. While we look at them we will explore some of the possible causes of these exceptions. Finally we will provide some pointers, that will help you to x your test code when you see them.
Are exceptions oracles?
So rst of all, what is an oracle? An oracle was traditionally seen as a portal that the gods used to talk to people. As with anything, there are various de nitions in use. To be clear about what an oracle is in the context of this book, we are going to use the following de nition:
"A statement believed to be infallible and authoritative"
Like an oracle, an exception is an infallible statement; it will always tell you why something has gone wrong in your code. It may not always be easy to understand, but it does always tell the truth. Let's have a look at some exceptions that we often see while writing and running Selenium tests and see what they are trying to tell us.