H
H
hatman2018-01-28 12:21:13
Software testing
hatman, 2018-01-28 12:21:13

How to correctly handle a non-existent locator when testing?

Hello everyone
There is an element that is hidden during certain actions. The task is to check that it is missing.
I request an element along the X-path through try, if it does not exist, I return false and then I check. The problem is that try takes a very long time, which greatly slows down the speed of this test. How can you throw an error faster for this particular test?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
denizen, 2018-01-29
@hatman

Take advantage of those functions that look for multiple elements, not just one.
In the absence of what they are looking for, they do not throw exceptions, but simply return an empty list.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question