Selenium Python - Handling No such element exception

前端 未结 5 1168
暗喜
暗喜 2021-02-14 01:33

I am writing automation test in Selenium using Python. One element may or may not be present. I am trying to handle it with below code, it works when element is present. But scr

5条回答
  •  迷失自我
    2021-02-14 02:05

    the way you are doing it is fine.. you are just trying to catch the wrong exception. It is named NoSuchElementException not nosuchelementexception

提交回复
热议问题