Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Articles by Debomita Bhattacharjee
Page 13 of 59
How to use dynamic GUID in Postman?
We can use dynamic GUID in Postman. This can be utilized in the request URL, Body or Headers by simply adding the value {{$guid}}. It does not need any declaration or initialization.Thus {{$guid}} can be used directly in Postman without any requirement of prior processing of the variable. Postman has support for dynamic variables. GUID is one such instance.We need not allocate memory or value for this variable. The syntax is {{$guid}}. Besides GUID, there are other dynamic variables like randomInt, timestamp, and so on in Postman.Usage of Dynamic GUID in URLUrl − https://www.tutorialspoint.com/index.htm?n={{$guid}}The above image shows the usage of ...
Read MoreManually Generating GUID in Postman
We can manually generate GUID in Postman with the help of the steps listed below −Step1 − Input the endpoint − https://www.tutorialspoint.com/index.htm in the address bar.Step2 − Add the below script under the Pre-request Script tab −var u= require('uuid') var ud = u.v4() console.log(ud)In the above script, require is used in JavaScript for loading a module. Then, the version 4 of the GUID is stored in the variable ud. Finally, the generated GUID is printed in the console.It must be remembered that we cannot use a variable with name guid within a Pre-request Script in Postman. However, the guid can ...
Read MoreWhat are Scripts In Postman?
Postman is developed on Node.js that gives dynamic characteristics to Collections and requests. We can create test suites, execute requests having changing parameters, send data in between requests, and so on.A JavaScript can be associated with a request twice. Once before the actual request has been sent(as a pre-condition script added under the Pre-Request Scripts tab)and after the Response from the request has been received (as a test script added under the Tests tab).Let us send a GET request along with Pre-Request and Test scripts.Pre-Request Script −console.log("Tutorialspoint - Postman")Testsconsole.warn("Warning message in console") console.log("Logging message in console") console.info("Info message in console") ...
Read MoreWhat is Postman Sandbox?
Answer − Postman Sandbox is an Environment provided to execute JavaScript written as a part of the Pre-Request and Tests scripts for a request. This can be available for both Postman and Newman. Thus every script developed under the Tests or Pre-Request Scripts tab can be executed within this Sandbox.Libraries and Utilities used in Postman Sandbox −Lodash - a utility in the JavaScript library.cheerio.BackboneJS.SugarJS.CryptoJS.Environment, Global, Dynamic variables & CookiesTo set an Environment variable, we have to add the below script −postman.setEnvironmentVariable(name of variable, value of variable)To set a Global variable, we have to add the below script −postman.setGlobalVariable(name of variable, ...
Read MoreHow to Share Session ID across Different Requests in Postman?
We can share session id across different requests in Postman. We can send a cookie value obtained from a request to a different request. This can be done only if the website is similar.A particular server can identify its own cookie. This makes a cookie highly secured. The cookies are passed to another request to store the information of the user preferences as it navigates through the webpages.A session id is similar to an expiration of a token. As the session id gets expired, an user has to again authenticate his credentials. As a user logs in for the first ...
Read MoreSelenium - Element is not clickable at point
We can get the error - Element is not clickable at point while trying to click a link in Selenium webdriver. This is common in chromedriver as the Chrome browser determines an element with point location.When the position of an element is changing and we make an attempt to click on it, this error is encountered. This is because the element is present in DOM, but its position is not fixed on the page.There are some workarounds to fix this error as listed below −Adding the explicit wait. The webdriver can wait till the expected condition - visibilityOf(webdriver shall wait ...
Read MoreHow to set Tests using Functional Method in Postman?
We can set Tests using the Functional method in Postman. A test in Postman gets executed only if a Request is successful. In case a Response does not get generated, the test does not to validate it.Tests implemented in the Functional method are written within the Tests tab.Add the following verification using the Functional method within the Tests tab −pm.test["Status Code is 401"], function(){ pm.response.to.have.status(401) })Here, pm.test is the function. Status Code is 401 is the test name which shall be displayed in the Test Result tab after execution. The pm.response is used for getting the Response ...
Read MoreHow do I keep a session alive for long Selenium scripts in automation?
We can keep a session alive for long Selenium scripts in automation. In Chrome browser, this can be achieved with the help of the ChromeOptions and Capabilities classes.Capabilities class can get the capabilities of the browser by using the method – getCapabilities. This technique is generally used for debugging a particular step in a scenario having a sizable amount of steps.First, let us try to input text in the highlighted edit box in the below page −Code Implementationimport org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.Capabilities; import org.openqa.selenium.By; import java.util.Map; import java.util.concurrent.TimeUnit; public class BrwSessionAlive{ public static void main(String[] args) ...
Read MoreHow to set Multiple Tests for a Request in Postman with JavaScript Method?
We can set multiple Tests for a Request in Postman with JavaScript method. A Test in Postman gets executed only if a Request is successful. In case a Response does not get generated, a test does not to validate it.Tests implemented in the JavaScript method are written within the Tests tab.Add the following JavaScript verifications within the Tests tab −tests["Status Code should be 200"] = responseCode.code === 200 tests["Response time lesser than 10ms"] = responseTime
Read MoreHow does Selenium Webdriver handle the SSL certificate in Edge?
We can handle SSL certificates in Edge browser with Selenium webdriver. This is done with the help of the EdgeOptions class. We shall create an object of this class and set the parameter setAcceptInsecureCerts to the true value.Finally, this information has to be passed to the webdriver object to get the desired browser settings. An SSL is a protocol designed to establish a secured connection between the server and the browser.SyntaxEdgeOptions e = new EdgeOptions(); e.setAcceptInsecureCerts(true);Code Implementationimport org.openqa.selenium.WebDriver; import org.openqa.selenium.edge.EdgeDriver; import org.openqa.selenium.edge.EdgeOptions; public class EdgeBrwserSSL{ public static void main(String[] args) { System.setProperty("webdriver.edge.driver", "C:\Users\ghs6kor\Desktop\Java\msedgedriver.exe"); ...
Read More