Skip to content

How to create an object repository

Mayank Gupta edited this page Jun 15, 2017 · 6 revisions

What is an object repository?

Object repository is the place from where Optimus finds the elements and performs the action on these elements according to the test.

Steps to create an object repository -

  1. Under the resources folder of your project, create a new folder and name it elements.
  2. You can either choose to group your object repositories according to the screen or you could directly store
    them with the file name same as the activity name in the case of Android.
  3. For locating the elements via Appium Inspector, please follow these steps.
  4. After successfully locating the elements, store them in the object repository as shown above.

How to store elements inside the object repository?

As you can see in the above image, the elements are stored in an object, to be specific, a JSON object.You have to specify the app name that is under test.Inside elements array, you need to store the name of the element, the identifier(xpath,id or class), the value of locator and/or waitFor.

Note : waitFor is optional.You may or may not use it.