Robot Framework Tutorial #27 – Working with Webelements

In this Robot Framework Tutorial we will understand how to use Selenium library keywords for working with Webelements in Robot framework automation.

Some of the Webelement keywords that I will explain in this tutorial are:

* Get Element Attribute – Returns the value of attribute from the element locator

* Get Element Count – Returns the number of elements matching locator

* Get Element Size – Returns width and height of the element identified by locator

* Get WebElement – Returns the first WebElement matching the given locator

* Get WebElements – Returns a list of WebElement objects matching the locator

* Capture Element Screenshot – Captures a screenshot from the element and embeds in log file

* Assign Id To Element – Assigns a temporary id to the element specified by locator

* Clear Element Text – Clears the value of the text-input-element identified by locator

* Double Click Element – Double clicks the element identified by locator

* Cover Element – Will cover elements identified by locator with a blue div

* Click Element At Coordinates – Click the element locator at xoffset/yoffset

* Element Attribute Value Should Be – Verifies element identified by locator contains expected attribute value

* Element Should Be Disabled – Verifies that element identified by locator is disabled

* Element Should Be Visible – Verifies that the element identified by locator is visible

* Element Should Not Be Visible – Verifies that the element identified by locator is NOT visible

* Element Should Contain – Verifies that element locator contains text expected

* Element Should Not Contain – Verifies that element locator does not contain text expected

* Element Text Should Be – Verifies that element locator contains exact the text expected

* Element Text Should Not Be – Verifies that element locator does not contain exact the text not_expected

* Element Should Be Enabled – Verifies that element identified by locator is enabled

* Element Should Be Focused – Verifies that element identified by locator is focused