This repository has been archived by the owner on Sep 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
image
sreepad edited this page Aug 17, 2016
·
4 revisions
image api should be used as below in screen objects.
image(:logical_name,Locator)
logical_name is a name to uniquely represent 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~//UIImage".
####Below methods are automatically created by using the above image method.
Below method clicks on image
logical_name
Below method checks for the existence of the image. returns true or false.
logical_name?
####Example:
If I have a 'logo' image on the screen, I would define as below:
image(:logo_image,"xpath~//UIImage")
Below methods are automatically created
logo_image
logo_image?
####Usage:
class Login
image(:logo_image,"xpath~//UIImage")
# DSL to click on Image logo.
def click_image
logo_image # This method is used to click on image
end
# DSL to check existence of capital one logo image
def check_logo_image
logo_image? # This will return true or false based on existence of logo.
end
end