when I type "NoSuchElementException" it simply doesn't find it, it simply does not recognize it as an exception because "except" only recognizes standard python exceptions and not selenium exceptions, any insights?
@@sdetunicorns I tried importing the entire selenium driver, when I type "except " it doesn't find it, it keeps suggesting the same standard python errors. How do I import selenium errors correctly? I am using chrome webdriver, python 3.9.7.
@@sdetunicorns thanks, it worked now, I just had to import exceptions from "selenium.common.exceptions", it seems that simply importing the entire library won't work
"production based" is no different, at the end you are handling the exceptions same way. You would probably have more abstraction to handle code more elegantly but other than that the basics remain the same.
A big big big thanks to you !! you made it really easy ..thanks a lot !
when I type "NoSuchElementException" it simply doesn't find it, it simply does not recognize it as an exception because "except" only recognizes standard python exceptions and not selenium exceptions, any insights?
Hi Rafael, you need to import errors from the selenium library first and then use it in your test so that it can recognize it
@@sdetunicorns oh.. ok, will try that
@@sdetunicorns I tried importing the entire selenium driver, when I type "except " it doesn't find it, it keeps suggesting the same standard python errors. How do I import selenium errors correctly? I am using chrome webdriver, python 3.9.7.
You can compare your code with mine and see if it works - github.com/automationbro/seleniumbase-tests/blob/master/tests/test_shop.py
@@sdetunicorns thanks, it worked now, I just had to import exceptions from "selenium.common.exceptions", it seems that simply importing the entire library won't work
do you have the git link of all this code
github.com/dilpreetj/selenide-youtube-series
Everyone showing just simple exception handling but not anyone showed production based and pythonic way to handle exceptions and log those .... 🥺
"production based" is no different, at the end you are handling the exceptions same way. You would probably have more abstraction to handle code more elegantly but other than that the basics remain the same.