Skip to main content

Posts

Showing posts from 2021

Json Response Deserialization

  How Do I Deserialize a JSON Response to a Class Using Rest Sharp? Let's continue from the earlier section, Creating a POST request with Rest-Sharp. In the earlier section, we made a successful post request and received the Response body shown below. To validate parts of the Response body, we used JObject.Parse. We will make this Response body into a Class. Deserialization of JSON refers to the process of converting a JSON or any structured data, including XML, into a programming class. Deserialization refers to the process of converting JSON from its String form to its Class form. This is also known as structured data object representation. JSON is used to represent structured data in this case. To integrate the JSON to a Class representation, we will first create a Class that contains all of the nodes in the JSON. There are three nodes in the Success response above. ·          Success code ·          Type ·          Message String is the value of these three nodes

SpecFlow Table with CreateInstance

  SpecFlow Table with CreateInstance We will use the same example of the Users Feature and modify it to suit our needs. Before proceeding, please review the first section of Data Driven Testing and see how the basic functionality works for the Users Scenario. 1) Add a New Step The first step is to create a new Step that will accept data in the form of a table. It is once again simple to specify data for the step in Vertical format. Simply enter the Fields and their Values.   Users.feature file Feature : Users        Operations about user Background :        Given I perform api operation on petstore server https://petstore.swagger.io/v2/ Scenario : POST operation with table using createinstance        When I perform POST operation for User using endpoint " /user " by creating createinstance | Id | username | firstname | lastname | email        | password   | phone       | userstatus | | 4 | Hithesh   | Hitesh     | Patil     | hitesh.p@gmai