Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 17, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      May 17, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 17, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 17, 2025

      Microsoft’s allegiance isn’t to OpenAI’s pricey models — Satya Nadella’s focus is selling any AI customers want for maximum profits

      May 17, 2025

      If you think you can do better than Xbox or PlayStation in the Console Wars, you may just want to try out this card game

      May 17, 2025

      Surviving a 10 year stint in dev hell, this retro-styled hack n’ slash has finally arrived on Xbox

      May 17, 2025

      Save $400 on the best Samsung TVs, laptops, tablets, and more when you sign up for Verizon 5G Home or Home Internet

      May 17, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      NodeSource N|Solid Runtime Release – May 2025: Performance, Stability & the Final Update for v18

      May 17, 2025
      Recent

      NodeSource N|Solid Runtime Release – May 2025: Performance, Stability & the Final Update for v18

      May 17, 2025

      Big Changes at Meteor Software: Our Next Chapter

      May 17, 2025

      Apps in Generative AI – Transforming the Digital Experience

      May 17, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Microsoft’s allegiance isn’t to OpenAI’s pricey models — Satya Nadella’s focus is selling any AI customers want for maximum profits

      May 17, 2025
      Recent

      Microsoft’s allegiance isn’t to OpenAI’s pricey models — Satya Nadella’s focus is selling any AI customers want for maximum profits

      May 17, 2025

      If you think you can do better than Xbox or PlayStation in the Console Wars, you may just want to try out this card game

      May 17, 2025

      Surviving a 10 year stint in dev hell, this retro-styled hack n’ slash has finally arrived on Xbox

      May 17, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»How to share data between steps in Cucumber feature file?

    How to share data between steps in Cucumber feature file?

    May 26, 2024

    I am designing automation scripts using the REST APIs, RestAssured with Cucumber BDD framework. I have multiple APIs where one API’s response is used as a parameter in another API.
    Here is my feature file:

    Feature: Create Order API

    @Background:
    Scenario Outline: Generate Access token With Valid Details
    Given Query param for request
    | grant_type |
    | client_credentials |
    Given Basic Auth keys for request “<userName>” and “<key>”
    When Build request for baseurl “PAYPAL_BASE_URI” and endpoint “ENDPOINT_GET_AUTH_KEY”
    And Perform “POST” request using
    Then status code is 200
    And response contains “scope”
    Examples:
    | userName | key |
    | AWnCb | EMAekuSA2f |

    Now the response of the above API is as follows:

    {
    “scope”: “https://uri.pppaypal.com/services/invoicing https://uri.pppaypal.com/services/applications/webhooks”,
    “access_token”: “ALs1szFnv2TJ19Zf3vq”,
    “token_type”: “Bearer”,
    “app_id”: “APP-284543T”,
    “expires_in”: 311286,
    “nonce”: “2022-05-31T03:41:41ZWs9dpOQ”
    }

    Now I need this “access_token” as in the “Create Order API” Authorization parameter with Bearer. also i need to pass “app_id” and “nonce” in the Create Order API. The “Create Order API” feature file is below:

    Scenario: Verify create order api using valid auth
    Given Generate request
    And Build request for baseurl “PAYPAL_BASE_URI” and endpoint “ENDPOINT_CREATE_ORDER_API”
    And Set header values as
    | Content-Type | Authorization | app_id | nonce |
    | application/json | <token> | <app_id> | <nonce> |
    When Perform “POST” request using “FILE_PATH_ORDER_JSON”
    Then status code is 201

    How can I get the values from the response of one API and the use that data in the next API as payload or query param in the same feature file so that I can use it anywhere in this feature file?

    Source: Read More

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleCannot see Jmter in Influxdb measurement
    Next Article Developments in Family of Claude Models by Anthropic AI: A Comprehensive Review

    Related Posts

    Development

    February 2025 Baseline monthly digest

    May 17, 2025
    Development

    Learn A1 Level Spanish

    May 17, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    Google’s One AI Premium plan with Gemini Advanced is now free for students – for an entire year

    News & Updates

    Kew: Listening to Music in the Linux Terminal

    Linux

    Guru Live project v1

    Development

    Best Memorial Day deals 2025: Save on handpicked early tech deals live now

    News & Updates

    Highlights

    Machine Learning

    Layer Parallelism: Enhancing LLM Inference Efficiency Through Parallel Execution of Transformer Layers

    February 14, 2025

    LLMs have demonstrated exceptional capabilities, but their substantial computational demands pose significant challenges for large-scale…

    Roborock’s new robot vacuum has a mechanical arm to move obstacles – and you have to see it

    January 5, 2025

    RTX 5060 Ti gets official support in NVIDIA’s newest driver, stability concerns are addressed

    April 16, 2025

    YouTube shuts down viral ‘hack’ for getting cheaper Premium subscription

    June 20, 2024
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.