Selenium Python Exception Handling | Selenium Python Tutorial

Поделиться
HTML-код
  • Опубликовано: 25 окт 2024

Комментарии • 12

  • @adityarastogi3483
    @adityarastogi3483 2 года назад

    A big big big thanks to you !! you made it really easy ..thanks a lot !

  • @shivanandhiremath8217
    @shivanandhiremath8217 Год назад

    do you have the git link of all this code

    • @sdetunicorns
      @sdetunicorns  Год назад

      github.com/dilpreetj/selenide-youtube-series

  • @rafaeljesus7596
    @rafaeljesus7596 2 года назад

    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
      @sdetunicorns  2 года назад

      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

    • @rafaeljesus7596
      @rafaeljesus7596 2 года назад

      @@sdetunicorns oh.. ok, will try that

    • @rafaeljesus7596
      @rafaeljesus7596 2 года назад

      @@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
      @sdetunicorns  2 года назад +1

      You can compare your code with mine and see if it works - github.com/automationbro/seleniumbase-tests/blob/master/tests/test_shop.py

    • @rafaeljesus7596
      @rafaeljesus7596 2 года назад +1

      @@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

  • @k.m.jiaulislamjibon1443
    @k.m.jiaulislamjibon1443 3 года назад +1

    Everyone showing just simple exception handling but not anyone showed production based and pythonic way to handle exceptions and log those .... 🥺

    • @sdetunicorns
      @sdetunicorns  3 года назад +1

      "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.