I’ve been there, Selenium is a hard guy if you get to use it extensively.
It will at some point make you feel like you’re on the wrong lane whereas you’re right
you need to understand somethings and that’s all.
This post will cover most selenium issue you will surely encounter if you already haven’t done so.
1 – Mismatched Driver
There are a lot of time, i just get the below message out of the blue
This issue does occur even after your projects has been running fine for some time.
It happens when the version of your browser is different from that of your selenium driver.
For example, installed chrome is version 79 but your chrome driver is version 78 or version 80.
This usually happens when your browser update it’s self.
So how do we fix this ?
By either upgrading or downgrading either of them. Do whichever .
All that matters for you to fix this issue is to make sure the browser version matches that of the selenium driver.
If your chrome browser version is 80, make sure you chrome driver is updated to 80 as well.
If your chrome driver were to be 79, you could as well just downgrade your browser to 79 but i wouldn’t recommend downgrading.
2 – Missing Driver
This issue of missing driver doesn’t happen except only if selenium can’t find your chrome driver.
You have to make sure your chromedriver is in path or simply just copy it in the same directory as script .
if you want to step up and handle it like a professional . you need to explicitly pass the location of your driver to selenium.
This way you can place the driver wherever you want. just need to pass in the path like i did above.
3 – Untimely Time
4 – InBrowser Error
These are errors that are specific to the browser and has nothing to do with selenium itself.
And the bad news is there’s no way your script can communicate the presence of this error neither does it get notify.
So it means no exception handling for you. Sorry.
After many years on this, i came up with my own custom solution.
The goes thus