Cinnamon Documentation

<<<<<<< HEAD ======= >>>>>>> gh-pages
Assert
BaseExplicitWaitTest
BaseTest
Capabilities
Context
Cookie
CookieManager
CSSLocator
ElementLocator
ExpectedCondition
ExpectedConditions
OrgUnderTest
PageObject
RemoteAlert
RemoteMouse
RemoteTouch
RemoteWebDriver
RemoteWebDriverServiceProvider
SelectOptionAdapter
StandardLayoutLocator
TableWebElement
TestUtil
VisualforceByHtmlTagLocator
VisualforceChildLocator
VisualforceLocator
Wait
WebElement
WindowSize

WebElement

global with sharing class WebElement
DescriptionThe WebElement class represents an HTML element. This class provides methods that allow you to interact with a page.

For example, the following sample code locates an input element (a save button) and use the WebElement.click() method to click the button:


   public void clickSaveButton() {
       cinnamon.WebElement saveButton = getElement(new cinnamon.VisualforceLocator('apex:commandButton', 'saveBtn'));
       saveButton.click();
   }
 

Methods

  clear

global void clear()
DescriptionClears the value from an input element. This operation only applies to text entry elements such as input and textArea.

  click

global void click()
DescriptionClicks on a link, button, or radio button element.

  getCssValue

global String getCssValue(String propertyName)
DescriptionReturns the current value of the property.
Returnsthe current value
Parameters
propertyNamethe name of the propertyName

  getElement

global WebElement getElement(ElementLocator locator)
DescriptionReturns a WebElement for the argument locator.
ReturnsA WebElement for the given locator.
Parameters
locatorThe ElementLocator for a particular element.

  getElementAttribute

global String getElementAttribute(String attribute)
DescriptionReturns the current value of a specific element attribute. If the attribute or the value isn't present, the method returns null.
ReturnsThe attribute or property's current value, or null if the value is not set.
Parameters
attributeThe name of the attribute.

  getElementRect

global ElementRect getElementRect()
DescriptionReturns a ElementRect for this element. x and y represent the top left coordinates of the WebElement relative to top left corner of the document. height and the width will contain the height and the width of this element.
Returnsa ElementRect for this element

  getElementTagName

global String getElementTagName()
DescriptionReturns the qualified name of the element
Returnsa string value that represents the qualified name of the rendered element

  getElementText

global String getElementText()
DescriptionReturns the visible innerText value of this element.
ReturnsThe visible innerText value of this element.

  getLocation

global String getLocation()
DescriptionReturns the location of this element when rendered on a Visualforce page.
ReturnsA string representing the location of this rendered element.

  getLocator

global String getLocator()
DescriptionReturns the locator value for this element.
ReturnsThe locator value for this element

  getSize

global String getSize()
DescriptionReturns the width and height of the rendered element.
ReturnsThe width and height of the rendered element.

  isDisplayed

global boolean isDisplayed()
DescriptionIndicates whether or not this element is displayed so you don't need to parse an element's "style" attribute.
ReturnsA boolean value that indicates whether or not this element is displayed.

  isEnabled

global boolean isEnabled()
DescriptionIndicates whether this element is enabled. More specifically, if a WebElement has a disabled attribute, or a form control is disabled, this method will return false.
Returnsa boolean value that indicates whether this element is enabled or not

  isSelected

global boolean isSelected()
DescriptionDetermines whether or not this element is selected. This operation only applies to input elements such as checkboxes, options in a select list, and radio buttons.
ReturnsTrue if the element is selected and false otherwise.

  sendKeys

global void sendKeys(String keys)
DescriptionSimulates typing into a text entry element. Current limitation: sending non-text keys is not working for IE9 and older browsers
Parameters
keystext input value to be typed

  sendKeys

global void sendKeys(Keys key)
DescriptionSimulates a key press for Keys defined in Keys.cls
Parameters
keyis a value from cinnamon.Keys enum representing the key to be pressed.

  sendKeys

global void sendKeys(List<Object> keys)
DescriptionSimulates a user pressing both printable and non-printable keys
Parameters
Alist of String and/or Keys. The example below would send the abc string, and then 3 backspace keystrokes, resulting in a blank inputfield (assuming it was blank before): someElement.sendKeys(new Object[] { "abc", Keys.BACK_SPACE, Keys.BACK_SPACE, keys.BACK_SPACE });

  WebElement

  WebElement

WebElement.ElementRect

global class ElementRect

  Properties

height
global Integer height
width
global Integer width
x
global Integer x
y
global Integer y
Assert
BaseTest
Context
ElementLocator
ExpectedCondition
ExpectedConditions
OrgUnderTest
PageObject
RemoteWebDriver
SelectOptionAdapter
TableWebElement
VisualforceByIdLocator
VisualforceLocator
Wait
WebElement

WebElement

global with sharing class WebElement
Description WebElement is a class that represents an HTML element. This class provides a set of methods that allow you to interact with a page. For example, below is a sample code which locates an input element (Save button) and use WebElement.click method to click the button:


public void clickSaveButton() {
    cinnamon.WebElement saveButton = getElement(new
    cinnamon.VisualforceLocator('apex:commandButton', 'saveBtn'));
    saveButton.click();
}
                    

Methods

clear

global void clear()
Description Clears the value from input element This operation only applies to text entry elements such as input, textarea

click

global void click()
Description Clicks on a link, button or radio button element

getAttribute

global String getAttribute(String attribute)
Description Returns the current value of a given attribute of the element. This method returns the value of the given attribute, unless that attribute nor the value is present, in which case null is returned.
Returns the attribute/property's current value or null if the value is not set
Parameters
attribute the name of the attribute

getElement

global WebElement getElement(ElementLocator locator)
Description Returns a WebElement for a given locator
Returns a WebElement for a given locator

getLocation

global String getLocation()
Description Returns the location of this rendered element
Returns a string value that represents the location of this rendered element

getLocator

global String getLocator()
Description Returns a locator value of this element
Returns a locator value of this element

getSize

global String getSize()
Description Returns the width and height of the rendered element
Returns the width and height of the rendered element

getText

global String getText()
Description Returns a visible innerText value of this element
Returns a visible innerText value of this element

isDisplayed

global boolean isDisplayed()
Description Indicates whether this element is displayed or not This method avoids the problem of having to parse an element's "style" attribute
Returns a boolean value that indicates whether this element is displayed or not

isSelected

global boolean isSelected()
Description Determines whether this element is selected or not. This operation only applies to input elements such as checkboxes, options in a select and radio buttons.
Returns a boolean that indicates whether this element is selected or not

sendKeys

global void sendKeys(String keys)
Description Simulates typing into an text entry element
Parameters
keys text input value to be typed

sendKeys

global void sendKeys(Keys key)
Description Simulates a key press for Keys defined in Keys.cls
Parameters
key is a value from cinnamon.Keys enum representing the key to be pressed. Current accepted values are cinnamon.Keys.ENTER and cinnamon.Keys.TAB

WebElement

global WebElement (ElementLocator locator, selenium1.DefaultSelenium selenium)