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
  • Introduction to Gherkin Language
  • Key Features of Gherkin
  • Basic Syntax
  • Comparison with Cucumber Framework
  • Scriptless Automation Framework
  • Conclusion

Was this helpful?

  1. Get Started

Gherkin Language and Scriptless Automation Framework

Introduction to Gherkin Language

Gherkin is a business-readable, domain-specific language that facilitates the description of software behaviors without the need for detailing their implementation. It serves as a bridge between technical and non-technical stakeholders, ensuring everyone has a clear understanding of the requirements and functionalities of the system.

Key Features of Gherkin

  • Readable by all: Gherkin uses natural language constructs that are easy to read and understand.

  • Structured format: It follows a specific syntax with keywords like Feature, Scenario, Given, When, Then, and And.

  • Supports BDD: Gherkin is widely used in Behavior-Driven Development (BDD), where it helps in defining the behavior of the system in a structured manner.

Basic Syntax

  • Feature: Describes the feature under test.

  • Scenario: Defines a particular scenario to be tested.

  • Given: Sets up the initial context of the scenario.

  • When: Describes the action that triggers the scenario.

  • Then: Specifies the expected outcome of the scenario.

  • And: Used to combine multiple Given, When, or Then steps.

Example

Feature: User Login
  This feature allows users to log in to the application.

  Scenario: Successful login with valid credentials
    Given the user is on the login page
    When the user enters a valid username and password
    And the user clicks the login button
    Then the user should be redirected to the dashboard

Comparison with Cucumber Framework

What is Cucumber?

Cucumber is a testing framework that supports BDD by running automated acceptance tests written in Gherkin. It provides a way to write tests that anyone can understand, regardless of their technical knowledge.

Key Differences Between Gherkin and Cucumber

  • Gherkin: A language for writing tests in a business-readable format.

  • Cucumber: A framework that executes Gherkin-written tests by mapping them to code (step definitions).

Challenges with Cucumber

  1. Step Definitions:

    • Cucumber requires mapping Gherkin steps to step definitions written in a programming language. This mapping can lead to errors if not managed correctly.

    • Mistakes in the mapper can result in Cucumber creating new step definitions, causing redundancy and increased maintenance.

    • As the number of test cases grows, the number of step definitions increases, leading to more code and maintenance overhead for engineers.

  2. Performance Issues:

    • Loading both feature files and step definitions simultaneously can lead to performance issues, especially with long-running tests.

Scriptless Automation Framework

In contrast to Cucumber, the Scriptless Automation Framework aims to simplify the automation process by eliminating the need for step definitions and reducing the maintenance burden.

Key Features of Scriptless Automation Framework

  • Template-Driven: The framework provides a template where the business team can write user stories. This template guides the automation process without needing detailed coding.

  • Locator Provision: Developers only need to provide locators for web elements, making it easier to maintain.

  • Directory-Based Organization: Test cases are organized in specific directories as per the documentation, simplifying the structure.

  • No Coding Required: Once the template is filled and locators are provided, no additional coding is necessary. This reduces maintenance and simplifies updates.

Benefits of Scriptless Automation Framework

  1. Reduced Maintenance: By eliminating step definitions, the framework reduces the code that needs to be maintained.

  2. Simplified Process: Business teams can directly write user stories in the template, making it easier for non-technical stakeholders to contribute.

  3. Scalability: The framework scales better with the increasing number of test cases since there are no step definitions to manage.

  4. Consistency: Ensures consistency in test case writing and execution, reducing the chances of errors.

Example Usage

Template

PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
gmail,NONE,NONE,NONE,LOAD_URL,https://www.gmail.com/,NONE,NONE
gmail,VISIBILITY,NONE,email,SEND_KEYS,prabhatgaddam,NONE,NONE
gmail,VISIBILITY,NONE,email,NONE,NONE,NONE,ATTRIBUTE_VALUE_PRESENT

Converted Gherkin

Feature: Gmail Login
  This feature allows users to log in to Gmail.

  Scenario: Load Gmail and enter email
    Given the user is on PAGE_NAME: "gmail"
    When the user waits for WAIT_TYPE: "NONE" and scrolls using SCROLL_TYPE: "NONE" on ELEMENT_NAME: "NONE" to perform ACTIONS: "LOAD_URL" with data SEND_KEYS: "https://gmail.com"
    Then the user waits for WAIT_TYPE: "VISIBILITY" and scrolls using SCROLL_TYPE: "NONE" on ELEMENT_NAME: "email" to perform ACTIONS: "SEND_KEYS" with data SEND_KEYS: "prabhatgaddam"
    Then the user waits for WAIT_TYPE: "VISIBILITY" and scrolls using SCROLL_TYPE: "NONE" on ELEMENT_NAME: "email" and verifies VALIDATION_TYPE: "ATTRIBUTE_VALUE_PRESENT"

Conclusion

The Gherkin language and Cucumber framework offer a powerful combination for behavior-driven development and automated testing. However, managing step definitions in Cucumber can become cumbersome as the test suite grows. The Scriptless Automation Framework addresses these challenges by providing a template-driven approach that simplifies the automation process, reduces maintenance, and makes it accessible to non-technical stakeholders. By using this framework, teams can achieve more efficient and maintainable test automation, allowing them to focus on delivering high-quality software.

PreviousTestData ConfigurationNextPoints to Remember

Last updated 11 months ago

Was this helpful?

👨‍💼