![]() We will go through all Locator Strategies and discuss them in detail. Learning which type of Locator Strategy to use is part of the learning process of becoming comfortable with Appium. If you recall our simple test cases in Chapter 2, our Appium Android example used the following code for identifying the Textview: Appium makes many different strategies available. The way in which you uniquely identify the element is called a locator strategy. As you will see, sometimes this is easy, and other times you have to do some further exploration to uniquely identify your UI element. This means that we need to find a unique address for the element. As there are many UI elements present on a single mobile application screen there can be a chance that same (generic)address can refer to more than one element. So What is an Element Locator? An Element Locator is nothing but an address that identifies a UI Element on a Mobile App (or Website). In this chapter we focus on the first step and will look into all the available Locator Finding Strategies and discuss each strategy’s pros and cons. In Mobile (or Web) Automation Testing automating any scenario follows these 2 steps: After all, if you’re unable to “find” the UI element, you cannot control it (such as clicking a button). ![]() Understanding how to properly use Locators is key to building your automation scripts.
0 Comments
Leave a Reply. |