Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.
sreepad edited this page Aug 17, 2016 · 6 revisions

button api should be used as below in screen objects.

button(:logical_name,locator)

logical_name is a name that uniquely represents a button.

locator could be name, id, accessibility id ,xpath etc.. locators are assigned to object by developers during design. For example, xpath locator should be defined as follows, "xpath~//UIButtonField".

####Below methods are automatically created by using the above button method

below method is used to click the button

logical_name  

below method checks for existence of the button. returns true or false

logical_name?  

below method checks if the button is enabled. returns true or false.

logical_name_enabled?  

below method returns text for button's value attribute.

logical_name_value  

below method scrolls to the first element and click. (iOS Specific)

logical_name_scroll  

below method first creates dynamic xpath and scrolls to the first element with exact dynamic xpath and clicks on the button.(iOS Specific)

logical_name_scroll_dynamic(text)  

below method scrolls to the first element containing target text and clicks on the button.(Android Specific)

logical_name_scroll_(text)  

below method first creates dynamic xpath and scrolls to the first element containing the target text and clicks on the button (Android Specific)

logical_name_scroll_dynamic_(text)  

below method scroll to the first element with exact target text and click on the button (Android Specific)

logical_name_scroll_exact_(text)  

below method first creates dynamic xpath and scrolls to the first element with exact target text and clicks on the button (Android Specific)

logical_name_scroll_dynamic_exact_(text)  

Please note that all the methods are automatically created with an extension to the logical name provided.

###Example:

If I have a login button on the screen/page, I would define as below:

button(:login_button,"xpath~//UIButtonField")

Below methods are automatically created

login_button

login_button?

login_button_enabled?

login_button_value

Clone this wiki locally