Robot Framework Tutorial #27 – Working with Webelements

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

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

* Get Element Attribute – Returns the value of an 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 the 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 the log file

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

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

* Double Click Element – Double clicks the element identified by the 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 the locator is disabled

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

* Element Should Not Be Visible – Verifies that the element identified by the 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 exactly the text not_expected

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

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