Avoiding typical failure points
There are many scenarios where the normal implementation would fail. We are going to discuss these failure points and will see how to tackle them.
In this section, we will work with the following entities to tackle failure points:
- Selectors
- Scope of the variable
- Delay
- Element Exists
Try
/Catch
toString
method
Selectors
Sometimes, it is tedious to deal with selectors while working with them. This is because a selector has attributes, title, and class properties. When we select a UI element using the selector, it stores all these properties. Different instances of an application may have different properties of a UI element.
The problem with selectors is when you select a UI element, it captures its properties. These properties will differ when we select the UI element of a different instance of an application with the selector. Hence, the property will differ and the selector will fail to recognize the same UI element of another instance of the application.
We can easily...