Within your selenium python test automation how do you quickly verify that popup does not exist?
There are two main aspects to this
- You need a check to determine whether an element exists or not that doesn’t take too long, e.g. either by determining a result instantly or by specifying a time limit / timeout.
- You need some kind of assessment to know that the element won’t show up later on.
You want to avoid a situation where you use a fast check (e.g. a fraction of a second) which determines that the popup is not visible at that point in time and then the popup shows up later.
If you know the duration until when the popup shows up or not then you can use an implicit wait as outlined here: https://selenium-python.readthedocs.io/waits.html#implicit-waits
If you rather base our assessment on a condition instead of or in addition to a duration (e.g. a different element on the page exists or is visible) the logic becomes more complicated, especially if you want to optimize the performance of your test automation. In that case it is helpful to determine what the most likely case is and make that check a priority and/or check for that condition first.
Quickly verify that popup does not exist