RBM - Configure Element Based Content Check using Playback Script

RBM - Configure Element Based Content Check using Playback Script

Element based Content Check option

Applications Manager's Real Browser Monitoring allows to configure content check for a particular element in the webpages. One can configure checks for both Content to be present and Content not to be present for the specified element.
Info
Syntax of the script:
  1. assert_element_keyword_present_check("<Identifier Type>", "<Identifier Value>", "<text>", "<true/false>")              -> Checks if the given text is present for the element
  2. assert_element_keyword_not_present_check("<Identifier Type>", "<Identifier Value>", "<text>", "<true/false>")       -> Checks if the given text is not present for the element

Proceed with further steps?

Applications Manager also provides an option to allow the user to choose whether to proceed with further steps (if any) in the transaction or not. The fourth parameter in the above script accepts Boolean (true/false) values only, based on which Applications manager decides whether to proceed with further steps or not, when the content check operation fails.

Notes
Definitions

<Identifier Type> - The type of the identifier used to locate the given element in the webpage. Ex - id, name, xpath.
<Identifier Value> - The value of the identifier used to locate the given element in the webpage. Ex - For id -> userName, for xpath ->  //*[@id='loginPage']/section/div[2]/form/input[6] 
<text>- Text content that needs to be verified for the presence for the given element in the webpage.
<true/false> - To decide whether to proceed with further steps or not, when the content check operation fails.


Examples:
  1. assert_element_keyword_present_check("id", "id_applications", "Applications", "true")      -> This script checks if the word 'Applications' is present for the element "id_applications" and continues to the next step even if the element or word or is not present.
  2. assert_element_keyword_present_check("id", "id_applications", "Applications", "false")      -> This script checks if the word 'Applications' is present for the element "id_applications" and continues to the next step only if the element and the word is present.

Steps to configure content check

  1. Visit the monitor details page of corresponding Real Browser Monitor.
  2. Choose "Monitor Actions" -> "Edit Playback Script" option. 'Real browser script viewer' window will be opened as a pop up.
  3. In the pop up dialog box, search for the step to which the content check needs to be added.
  4. Add the script line, referring to the syntax as mentioned above, based on your requirement. The requirement might vary
    1. Whether to check if the text is present or not present in an element.
    2. Whether to check the content of an element before or after the intended action.
  5. Example for 'assert_element_keyword_present_check':
  6. Example for 'assert_element_keyword_not_present_check':


Notes
Note:
1. The content provided for Element based content check has to be directly visible in the page.
2. The contents present in Element title, mouseover, placeholder, value, label should not be provided.