Found 161 Articles for Rest Assured

How to upload a file in Cypress?

Debomita Bhattacharjee
Updated on 19-Nov-2021 09:44:28

6K+ Views

We can upload a file in Cypress. To perform the file upload task in Cypress, we have to first install a plugin with the command −npm ins tall –dev cypress-file-uploadOnce the installation is done, we have to add the statement import 'cypress-fileupload' in the command.js file which resides inside the support folder within our Cypress project. Also, we shall add the file that we want to upload within the fixtures folder(Picture.png file).To upload a file, we have to use the Cypress command, attachFile, and pass the path of the file to be uploaded as a parameter to it.ExampleImplementationdescribe('Tutorialspoint Test', function ... Read More

What is a Cypress Alias?

Debomita Bhattacharjee
Updated on 19-Nov-2021 09:39:55

125 Views

Cypress aliases are an important component that has multiple uses. They are listed below −Sharing ContextWe have to use .as() to alias something that we have to share. To alias objects and primitives, Mocha context objects are used. The aliased object can be accessed with - this.*.Mocha by default shares context for all the hooks applicable for the test and the alias properties are flushed post the execution of a test.describe('element', () => {    beforeEach(() => {       cy.wrap('eleone').as('x')    })    context('subelement', () => {       beforeEach(() => {          cy.wrap('eletwo').as('y') ... Read More

How to create a POST request in Postman?

Debomita Bhattacharjee
Updated on 18-Nov-2021 13:17:15

2K+ Views

Postman POST request allows appending data to the endpoint. This is a method used to add information within the request body in the server. It is commonly utilized for passing delicate information.Once we send the request body via the POST method, the API, in turn, yields certain information to us in Response. Thus a POST request is always accompanied by a body in a proper format.Create a POST RequestStep1 − Click on the New menu from the Postman application. The Create New pop-up comes up. Then click on the Request link.Step2 − SAVE REQUEST pop-up comes up. Enter Request name ... Read More

How to create a DELETE request in Postman?

Debomita Bhattacharjee
Updated on 18-Nov-2021 13:06:12

12K+ Views

Postman DELETE request deletes a resource already present in the server. The DELETE method sends a request to the server for deleting the request mentioned in the endpoint. Thus it is capable of updating data on the server.Before creating a DELETE request, we shall first send a GET request to the server on the endpoint :http://dummy.restapiexample.com/api/v1/employees.On applying the GET method, the below Response Body is obtained.Let us delete the record of id 2 from the server.Create a DELETE RequestStep 1 − Click on the New menu from the Postman application. The Create New pop-up comes up. Then click on the ... Read More

How to create a PUT request in Postman?

Debomita Bhattacharjee
Updated on 14-Sep-2023 01:41:28

30K+ Views

A Postman PUT request is used to pass data to the server for the creation or modification of a resource. The difference between POST and PUT is that POST request is not idempotent.This means invoking the same PUT request numerous times will always yield the same output. But invoking the same POST request numerous times will create a similar resource more than one time.Before creating a PUT request, we shall first send a GET request to the server on an endpoint:http://dummy.restapiexample.com/api/v1/employees.On applying the GET method, the Response body obtained is −Now, let us update the employee_salary and employee_age for id ... Read More

How to parameterize requests in Postman?

Debomita Bhattacharjee
Updated on 18-Nov-2021 12:46:04

7K+ Views

We can parameterize Postman requests to execute the same request with various sets of data. This is done with the help of variables along with parameters. A parameter is a part of the URL used to pass more information to the server.The data can be used in the form of a data file or an Environment variable. Parameterization is an important feature of Postman and helps to eliminate redundant tests. Parameters are enclosed in double curly braces {{parameter}}.Let us take an example of an URL:https://www.tutorialspoint.com/index.htm. We shall create a variable as URL then use it for parameterization of the request. ... Read More

How to create sessions in Postman?

Debomita Bhattacharjee
Updated on 18-Nov-2021 12:41:59

429 Views

A session is a temporary fold that stores values of variables. They are used for the present instance and have a local scope. In Postman, we can modify the session variable value to share workspace among teams.Postman gives the feature of local session share. Even if a Collection can be shared among teams, the sessions are never shared. Different tokens have to be generated while a task is to be carried out in a team structure.A session has a local scope for a user within his Workspace and any modifications he makes shall not be reflected in the server. In ... Read More

What is the Scenario Outline keyword in Cucumber?

Debomita Bhattacharjee
Updated on 18-Nov-2021 12:39:59

396 Views

Scenario Outline is used to replicate the same Scenario with a different data set. Writing the same tests with different values is cumbersome and time taking. For instance, We can club the above two scenarios with the Scenario Outline.Thus, we see that a Scenario Outline should be accompanied by keyword Examples. A Scenario Outline is executed once for each of the rows appearing below the Examples segment.Also, we have seen that the Given step has the delimiter. It points to the header of the Examples table. SpecFlow shall put the values within this table before the task of matching ... Read More

What is the Example keyword in Cucumber?

Debomita Bhattacharjee
Updated on 18-Nov-2021 12:37:56

4K+ Views

We can perform data-driven testing with the help of keyword Examples. We shall also take the help of keyword Scenario Outline to execute the same Scenario over multiple values.The data sets to be taken into consideration shall be passed below the Examples section one after another separated by | symbol. So, if there are three rows, we shall have three test cases executed from a Single scenario.Also, the Given step has the delimiter. It points to the header of the Examples table. SpecFlow shall put the values within this table prior to the task of matching a step with ... Read More

What is the Background keyword in Cucumber?

Debomita Bhattacharjee
Updated on 18-Nov-2021 12:30:23

8K+ Views

The Background keyword is applied to replicate the same steps before all Scenarios within a Feature File.Background RulesLet us describe some of the rules while applying Background −It should be used for defining simple steps unless we are forced to bring the application to a state which requires complicated steps to be carried out. As requested by the stakeholders of the project.It should be brief and realistic.All the Scenarios should also be short and to the point.Background ExampleLet us see an example where we have used Background steps to be executed before all the tests in the Feature File. For ... Read More

Advertisements