"VERIFY_ELEMENT" Command

Description: This command verifies the existence or non-existence of an element on screen defined by a locator or inline XPath. It also allows modifying the number of attempts and the seconds between attempts, in addition to checking disabled or invisible elements.

Usage Scenario: Suppose we want to verify that the user no longer has friends after adding them all to the blacklist by checking if the paragraph with text “'The user does not have any friends” is visible.

Procedure: Define your locator with reference name “reference_friends.text.no_friends” or use inline XPath where the HTML tag is

<p class="lead ng-scope" ng-show="ctrl.getUsers().data.content.length === 0 || !ctrl.getUsers()"> The user does not have any friends.</p>

and the XPath is

//p[contains(text(),'The user does not have any friends')]

Then use the locator or inline XPath in your step and make sure that “Exist” is checked. Your step will look like this:

Web Locator:

Inline XPath:

See the Test LIbrary path: subject7_samples/subject7_advanced_suite/subject7_add_user_to_blacklist

The video following video demonstrates how the paragraph element “The user does not have any friends” is verified to be present after adding all users to the blacklist as part of execution of “subject7_add_user_to_blacklist” test case in “subject7_samples” folder: