Validating Elements, Text or Images
Cycle includes Steps for validating that elements, text, and images exist on a web page. Here are some of the Steps available:
And I see "<TEXT>" in title in web browser
And I see element "<ELEMENT_ID>" which is located <ABOVE|BELOW|LEFT OF|RIGHT OF> element "<ELEMENT_ID>" in web browser
And I see "<TEXT>" matches all text in element "<ELEMENT_ID>" in web browser
And I do not see "<TEXT>" in web browser within <NUMBER> seconds
And I see image "Image:<IMAGE_FILE_PATH>" in web browser with correlation <NUMBER>
I verify attribute "<ATTRIBUTE>" from element "<LOCATOR>" contains "<TEXT>" in web browser
The full list of web Steps is available in the Step Guide, which can be accessed via the Cycle application, or in the User Portal.
Copying text
Steps for copying text on a web page to a variable are also included in Cycle. Some of these Steps available include:
Given I copy current URL in web browser to variable "<VARIABLE_NAME>"
And I copy text inside element "<ELEMENT_ID>" in web browser to variable "<VARIABLE_NAME>" within <NUMBER> seconds
And I copy text inside element "<ELEMENT_ID>" from character <NUMBER> through <NUMBER> in web browser to variable "<VARIABLE_NAME>"
And I copy property "<PROPERTY>" from element "<LOCATOR>" in web browser to variable "<VARIABLE_NAME>"
A note on Attributes versus Properties
Cycle has steps which test element attributes and properties, but which is what can sometimes be unclear. In general, attributes are customizations to the HTML tag, whereas properties are computed about an element in the Display Object Model (DOM).
You might see an element like this:
<div id="video-tab-content" class="video-tab-content">
In this situation, the id and class are both attributes. If you investigate with the inspect tool, you might see that it has the property of "display: block".
You might also see that an element has an HTML tag that includes something which might also be a property, like display or value. Web frameworks work in all sorts of different ways, so be mindful of that while testing.