Skip to content

Optimus Generic Dictionary

Krishnanand B edited this page Jul 14, 2017 · 16 revisions

Dictionary will consist of all the actions that can be performed on a element or on a set of elements.
The basic actions that are available in dictionary are:
Tap
Slide
Scroll Up/Scroll Down
Assert(Visible/Enabled/TextPresent)
Swipe(swipeleft/swiperight)

1. Tap


Tap is used to tap an element only once/single tap.

to use this particular action you have to create a feature file and a json file.

  • example.feature


    where
    user : the user who is using the app,
    home : the current screen on which the user wants to work/where the elements are located,
    taps : an event which can be performed on an element,
    plan : the element on which an action will be performed.

  • [ScreenName].json(in this case Planning.json)


    where
    elements : an array of all the different elements exists on a particular screen,
    elementsName : user-defined name of an element,
    identifier : the mean by which an element can be identified(i.e. id, xpath, classname),
    value: value of element,
    waitFor : defines on how to wait for the element.

2. Slide


This transition tracks changes to the visibility of target views in the start and end scenes and moves views in or out from one of the edges of the scene.

  • example.feature

    where
    saveTax : the current screen on which the user wants to work/where the elements are located,
    slides : an event which can be performed on an element,
    annualCTC : the element on which an action will be performed,
    60% : the value upto which the slider will slide.

  • saveTax.json

    .

    here referTo will define the this particular item is common in many places and we don't want to create a new entry to use it every time, so in order to that we will use referTo which will refer this element to CommonElements.json which will consist all the repeating elements having a same value and locator at more then one place.
    CommonElements.json

3. Scroll Up/ Scroll Down


Scrolling allows the user to scroll up or down until the targeted element is found on the page or else will throw an exception if the element is not found.

example.feature

Home.json

4. Assert(Visible/Enabled/TextPresent)


Assert allows user to perform assert actions on a element, i.e element is visible, element is enabled, etc.

* Example.feature

* Planning.json

5. Swipe


Swipe lets you to move the screen in a particular direction either in right direction or in left.

* Example.feature

  • Home.json