ScriptlessAutomation
  • 👋Welcome to Scriptless Automation
  • Discover More About Automation
    • ⚙️Automation platform intro
    • 💡Advantages of Scriptless Automation
    • 🚀Release Notes
      • 📖Open Code
      • 📕License Code
  • Product tools
    • 📪Pre-request Tools
    • 🔧Project Dependencies
  • Automation Architecture
    • 🎨Flow diagram
  • Get Started
    • 🛠️Start with Automation
    • 📖Open Code Automation
      • 🌏Web Automation
      • ↔️API Automation
    • 🏢Maven Configuration
    • 🗜️Setting Up Maven Project in IntelliJ IDEA
    • 🎛️Scriptless Config
      • 🕸️BrowserConfiguration
        • chrome.properties
      • 👥CommunicationConfiguration
        • SlackConfiguration.properties
      • 📧MailConfiguration
        • gmailCredentials.properties
      • 🛂ReportConfiguration
        • extentReportConfiguration.properties
      • 🕵️TestManagementConfiguration
        • testRail.properties
        • zephyrscale.properties
        • testiny.properties
      • ⚙️testNgConfiguration.properties
    • 🍱TestData Configuration
    • 👨‍💼Gherkin Language and Scriptless Automation Framework
  • Automation Import Notes
    • 🎨Points to Remember
  • Automation Platforms
    • 👾ScriptlessApi Automation
      • 🖊️Introduction
      • 🗜️Api Automation Setup
      • 🔃Supported API Request Types
      • 🪧API Automation Template
      • 📚Example of API Requests
        • ⬇️GET
        • ↕️POST
        • ⤵️PUT
        • ❌DELETE
      • 🎯API Response Validation
      • 👨‍👦API Dependent TestCase
      • 📝Store API Variables
      • 📔API with JSON body
      • 🙋‍♂️Api Wait
      • 🗜️API Schema Validation
      • 🏗️API Tailor-Made coding
      • 👨‍🦯API Support Generator
      • ↘️Api Response Store Objects
      • ✍️API Test Report
      • 🚃Api Response Type Validation
    • 🌐ScriptlessWeb Automation
      • 🖊️Introduction
      • 🗜️Web Automation Setup
      • 🪧Web Automation Template
      • 🧮page_object_locators
      • 📜Web Automation Key Phrases
        • 📃PAGE_NAME
        • ⌛WAIT_TYPE
        • 📜SCROLL_TYPE
        • 👨‍💼ELEMENT_NAME
        • 🏎️ACTIONS
        • ⌨️SEND_KEYS
        • ✔️VALIDATION
        • ✅VALIDATION_TYPE
      • 👨‍👦Web Dependent Test Case
      • 🐒MOCK
      • 🛂AutomationAsserts
      • 🏗️Web Tailor-Made coding
      • 📝Store Web Variables
      • 🤼‍♀️Web & API integration
      • 🖇️Dynamic Strings
      • 🗣️ReadFile Annotation for Custom Code
      • 🖼️Page_Comparison
      • 👨‍💼Gherkin Template for Web Automation
    • 📱Mobile Automation
  • 🪶Automation features
    • 🌲Environment and System Variables
    • 🗝️KeyInitializers
      • Types of KeyInitializers
    • ✍️Reporting
      • Dashboard
      • Category
      • Tests
        • Screenshot Section
    • 👯Parallel Testing
    • 🏗️Tailor-Made Coding
  • ⏩Automation Demo
Powered by GitBook
On this page

Was this helpful?

  1. Automation Platforms
  2. ScriptlessWeb Automation
  3. Web Automation Key Phrases

VALIDATION

PreviousSEND_KEYSNextVALIDATION_TYPE

Last updated 7 months ago

Was this helpful?

In the Scriptless Automation Framework, the VALIDATION field is essential for specifying the expected outcomes or values against which the state or properties of web elements are checked during automation tests. This field is effectively paired with VALIDATION_TYPE to enable various forms of validation checks.

Role of the VALIDATION Field

  • Purpose: The VALIDATION field is used to define the expected result or benchmark for comparison during the validation of web elements.

  • Versatility: Its usage varies depending on the chosen VALIDATION_TYPE, catering to a wide range of validation scenarios.

Interaction with VALIDATION_TYPE

The VALIDATION_TYPE dictates how the VALIDATION field is employed:

EQUAL_IGNORE

Compares the web element's text with the value in VALIDATION, ignoring case differences.

Example:

PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
SwagLabs,NONE,NONE,pageTitle,NONE,NONE,Swag Labs,EQUAL_IGNORE

Tutorial:

IS_DISPLAY

This type does not utilize VALIDATION, focusing instead on the element's visibility.

Example:

PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
SwagLabs,NONE,NONE,pageTitle,NONE,NONE,NONE,IS_DISPLAY

Tutorial:

IS_BUTTON_ENABLE / IS_BUTTON_DISABLE

These types do not use VALIDATION, assessing the enablement or disablement of a button element.

Example:

PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
SwagLabs,NONE,NONE,loginButton,NONE,NONE,NONE,IS_BUTTON_ENABLE
SwagLabs,NONE,NONE,loginButton,NONE,NONE,NONE,IS_BUTTON_DISABLE
ATTRIBUTE_VALUE_PRESENT / ATTRIBUTE_VALUE_NOT_PRESENT

Here, VALIDATION specifies the attribute value to check for its presence or absence.

  • Example for ATTRIBUTE_VALUE_PRESENT:

    PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
    SwagLabs,NONE,NONE,userName,NONE,Automation,NONE,NONE
    SwagLabs,NONE,NONE,userName,NONE,NONE,NONE,ATTRIBUTE_VALUE_PRESENT
  • Example for ATTRIBUTE_VALUE_NOT_PRESENT:

    PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
    SwagLabs,NONE,NONE,userName,NONE,NONE,NONE,ATTRIBUTE_VALUE_NOT_PRESENT
ATTRIBUTE_EQUAL_IGNORE

Compares an attribute's value against the VALIDATION field value, ignoring case. VALIDATION should follow the template attributeExpected|attributeProperty.

Example:

PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
SwagLabs,NONE,NONE,userName,NONE,NONE,form_input|class,ATTRIBUTE_EQUAL_IGNORE
ATTRIBUTE_EQUAL

Compares an attribute's value against the VALIDATION field value. VALIDATION should follow the template attributeExpected|attributeProperty.

  • Example:

    PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
    SwagLabs,NONE,NONE,userName,NONE,NONE,form_input|class,ATTRIBUTE_EQUAL
ATTRIBUTE_CONTAINS

Ensures the attribute's value contains the substring provided in the VALIDATION field.VALIDATION should follow the template attributeExpected|attributeProperty.

  • Example:

    PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
    SwagLabs,NONE,NONE,userName,NONE,NONE,form_input|class,ATTRIBUTE_CONTAINS
CUSTOM

Custom validation logic may vary in its use of the VALIDATION field.

CSS_PROPERTY

Added a feature for validating CSS property types, enabling users to ensure UI components match expected CSS values accurately. VALIDATION should follow the template "cssExpected | CssPropertyName".

  • Example: To validate the font-family of a page title in SwagLabs, the syntax would be:

    Copy

    PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
    SwagLabs,NONE,NONE,pageTitle,NONE,NONE,"""DM Mono"", ""sans-serif""|font-family",CSS_PROPERTY
PAGE_COMPARISON

Validate the screenshot taken from the driver against the expected screenshot stored in directory test_data/web/page_screenshot .

PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
NONE,NONE,NONE,NONE,LOAD_URL,https://www.saucedemo.com/,NONE,NONE
SwagLabs,VISIBILITY,NONE,userName,SEND_KEYS,$text.firstName,NONE,NONE
SwagLabs,NONE,NONE,pageTitle,NONE,NONE,screenPage,PAGE_COMPARISON
NOT_EQUALS

Validate the element text is not equal to the expected text.

PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
NONE,NONE,NONE,NONE,LOAD_URL,https://www.saucedemo.com/,NONE,NONE
SwagLabs,NONE,NONE,pageTitle,NONE,NONE,Swag Lab,NOT_EQUALS
IS_NOT_DISPLAY

Validate the element is not visible on the HTML page.

PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
NONE,NONE,NONE,NONE,LOAD_URL,https://www.saucedemo.com/,NONE,NONE
SwagLabs,NONE,NONE,pageTitle,NONE,NONE,NONE,IS_NOT_DISPLAY
IS_ELEMENT_PRESENT

Validate the element is present/display on the HTML page

PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
NONE,NONE,NONE,NONE,LOAD_URL,https://www.saucedemo.com/,NONE,NONE
SwagLabs,NONE,NONE,pageTitle,NONE,NONE,NONE,IS_ELEMENT_PRESENT
IS_ELEMENT_NOT_PRESENT

Validate the element is not present/display on the HTML page

PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
NONE,NONE,NONE,NONE,LOAD_URL,https://www.saucedemo.com/,NONE,NONE
SwagLabs,NONE,NONE,pageTitle,NONE,NONE,NONE,
NONE

Indicates no validation is required, rendering the VALIDATION field unused.

Example Scenarios

  • If VALIDATION_TYPE is EQUAL_IGNORE and VALIDATION is "Submit", the framework checks if the element’s text is "Submit", irrespective of case.

  • For IS_DISPLAY, the VALIDATION field is not necessary; the framework simply confirms the element's presence.

DEMO ->

🌐
📜
✔️
https://youtu.be/X7RBAiojoeo
https://youtu.be/SgxgHDhD2d4
https://youtu.be/4YNpkKYCopI
https://youtu.be/MmlHqld809w