Selenium CSS Selectors Examples

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:21:19

867 Views

 We can locate elements with locator CSS Selector in Selenium webdriver. The general expression to create a CSS expression is tagname[attribute='value']. We can utilize the id and class attributes to create a CSS.With id, the syntax of a CSS expression is tagname#id. For instance, for a CSS expression - input#txt-loc, input is the tagname and the txt-loc is the value of the id attribute.With class name, the syntax of a CSS expression is tagname.class. For instance, for a CSS expression - input.txt-cls, input is the tagname and the txt-cls is the value of the class attribute.If there are n sub-elements(children) ... Read More

Get Value of Environment Variable in Postman

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:19:09

5K+ Views

We can get the value of an Environment variable in Postman at runtime with the help of scripts. This is done with the help of the pm.* function. The script to get the Environment variable can be included either in the Tests or Pre-Request Script tabTo get an Environment variable, the script should be −pm.environment.get('')Finally, to get the value of the Environment variable in the Postman console, the script should be −console.log(pm.environment.get(''))Let us try to get the value of the Environment variable tutorial.Step1 − Add the below script to get the value of the Environment variable tutorial and print it ... Read More

Clear Global Variables in Postman

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:17:33

2K+ Views

We can clear the Global variables in Postman at runtime with the help of scripts. This is done with the help of the pm.* function. The script to clear the Global variables can be incorporated either in the Tests or Pre-Request Script tabTo clear the Global variable, the script should be −To clear the Global variable, the script should be −pm.globals.unset('')Let us try to clear the Global variable url.Step1 − Add the below script in the Pre-request Script tab −pm.globals.unset('url')Step2 − Click on Send to execute a request.Step3 − After the Response is received, click on the eye icon to ... Read More

Create Global Variable in Postman

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:16:10

1K+ Views

We can create a Global variable in Postman. A Global variable can be utilized in all the Environments and can be applied to all requests. In Postman, if we have the same variable name for the Global and Environment variable, then the preference is given to the Environment variable.To create a Global variable follow the steps listed below −Step1 − Click on the eye symbol appearing right of the No Environment dropdown. Then click on Edit in the Globals section.Step2 − The MANAGE ENVIRONMENTS window comes up. Here, we have added the variable url and set the value as https://www.tutorialspoint.com/index.htm. ... Read More

Creating Variables Using Pre-request Script in Postman

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:14:26

4K+ Views

We can create variables using Pre-Request Script in Postman. We can set, update, or clear variables prior to the execution of the actual request. To set an Environment variable, we have to add the below script under the Pre-Request Script tab.postman.setEnvironmentVariable(name of variable, value of variable)To set a Global variable, we have to add the below script under the Pre-Request Script tab.postman.setGlobalVariable(name of variable, value of variable)Step1 − Select an Environment – Environment_Test from the No Environment dropdown.Step2 − In the address bar enter {{URL}} (an Environment variable available to the Environment_Test). Hover over {{URL}} to find the Scope of ... Read More

Manage Cookies in Postman

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:13:13

2K+ Views

We can manage Cookies in Postman. We can add, delete and update a cookie. The cookies are information dispatched by the server and saved in the browser.When a request is sent, the cookies are yielded by the server. The cookies are mentioned under the Headers and Cookies tab in the Response in Postman. To work with Cookies, we have to click on the Cookies link available under the Params tab.On clicking on it, the MANAGE COOKIES appears. It contains all the available cookies along with the options – Add Cookie and Delete.To add a cookie, click on the Add Cookie ... Read More

Local Scope Variables in Postman

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:12:31

945 Views

The local variables in Postman are also known as the Environment variable. The scope of the local variable is confined to the Environment in which it is created.The steps to create a local variable are listed below −Step1 − Click on the New menu, then click on Environment.Step2 − MANAGE ENVIRONMENTS pop-up gets launched. We will enter the Environment name as ENV1. Then we will add a variable u and its value as https://jsonplaceholder.typicode.com/users. Next, close the pop-up.Step3 − The new Environment (ENV1) will be available as one of the items in the No Environment dropdown.Step4 − Select the ENV1 ... Read More

Specify Path to Save Newman Report on Jenkins Using Postman

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:10:19

724 Views

We can specify the path to save Newman's report on Jenkins. Jenkins reports are available in various formats and can be managed by appending flags in the build commands. Besides, we can mention the path of the directory where the reports shall get saved with the help of these build commands.The steps to specify the path to save Newman reports on Jenkins are listed below −As a pre-condition, Jenkins should be established in the system. The steps to work with Jenkins are available in the link − https://www.tutorialspoint.com/jenkins/index.htm. Moreover, the Newman should be installed in the system and a Collection ... Read More

Set a Global Variable in Postman

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:08:01

11K+ Views

The global variables can be accessed by all the Environments and is available for every request. To set a global variable follow the below steps −Step1 − Click on the eye icon beside the No Environment dropdown and then click on the Edit link within the Globals section.Step2 − MANAGE ENVIRONMENTS pop-up opens up. Here, we have added the variable url and the value as https://www.tutorialspoint.com/index.htm. Click on Save then close the pop-up.Step3 − Now, select a different Environment and see if the Global variable url is accessible. Here, we have two different Environments - Environment_Test and Mock Server.Step4 − ... Read More

Create an Environment in Postman

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:05:30

6K+ Views

We can create an Environment in Postman. An Environment is a group of variables that we can use in a Postman request. By creating Environments for production, testing, staging and so on, we can run the same URL in various Environments.Step1 − Click on the eye icon beside the No Environment dropdown and then click on the Add link within the Environment section.Step2 − MANAGE ENVIRONMENTS pop-up opens up. We will enter the Environment name. Here, we have added the variable u and the value as https://jsonplaceholder.typicode.com/users. Then close the pop-up.Step3 − The new Environment (ENV1) displays as one of ... Read More

Advertisements