Categories: Uncategorized

by Jerome Josephraj

Share

REST uses four Authentication mechanisms and one of the popular authentication mechanisms is “Token Authentication” or “Bearer Authentication”. As the name “Bearer Authentication” suggests this type of authentication gives access to the bearer of this token. The token is a cryptic number and generated by the server in response to a login request. The client uses this token in the header of subsequent API calls in order to access protected APIs.

In this blog, let’s look at a step by step example of how this dynamically generated Token can be generated and passed to another Step in your Feature using NoCodeBDD. Creating Feature, Scenarios, Steps and rolling out Behavior Driven Development and Automating using NoCodeBDD literally takes minutes and all can be done without writing any code. If you are new to NoCodeBDD, you can see one of our previous blog that shows how REST API testing can be automated in minutes without writing any code

Step 1: Create Token

In order to pass the Token, it has to be created first. This can be done by calling the login API as shown in the example below. Once the login API is called, you can see result of that in the Audit screen

Step 2: Pass Token using JSON Path

You can pass result of any previous steps to subsequent steps using JSON Path. For an example, in the API that is called in Step 1, the token value can be passed to any subsequent Steps in that Scenario by simply providing the JSON Path for that token. If you are not familiar with JSON Path, there are several online tools available such as JSONPathFinder. We have put together a tutorial on how to find JSON Path for any element. The tutorial is very handy to find any JSON Path.

As you can see, passing Token or any values from one BDD Step to another Step in NoCodeBDD is as easy as providing the JSON Path. As mentioned before the response from a Step, can be passed to any Steps within that Scenario. When a Step is executed, NoCodeBDD walks back all the previous steps response and pull the required element if a JSON Path is provided.

STAY IN THE LOOP

Subscribe to our free newsletter.

Related Posts

View all

  • I had the pleasure of hosting a webinar with two industry experts, Rebecca Stone from IBM. During the webinar, Rebecca shared her experience in successfully implementing BDD in a large government project, highlighting the benefits of BDD, why and how she used OOPSI and its role in overcoming challenges faced […]

    Continue reading
  • Key Considerations for Rolling Out BDD in a Project Key Considerations for Rolling Out BDD in a Project

    Rolling out BDD in a project requires careful planning and a well-structured process. As a tech consultant on a large project, I had to make several changes to their BDD process and automation suite implementation. Some changes were straightforward, while others proved more challenging. If you’re considering implementing BDD in […]

    Continue reading
  • 10 Tips for Writing Effective BDD Scenarios When rolling out BDD having a clear and concise scenario writing is a vital aspect of successful BDD adoption. This blog post will provide you with 10 tips to enhance your BDD scenario writing, making it easy to understand, maintainable, and efficient. 1. […]

    Continue reading
  • It will be difficult to automate testing if you don’t consider it when creating your web application. It will be difficult, regardless of whether you are a code wizard or a no-code ninja. Here are some crucial ideas to have in mind as you develop your app to make testing a […]

    Continue reading