Releases: thunderclient/thunder-client-support
Releases · thunderclient/thunder-client-support
v2.18.0
New Features
Autocomplete
Environment variables #151, #1194- Allow
Skip Folder
Option in Run Collection #1476 Skip Collection
option in CLI for Run ALL Collections- Save
Active Environment
selection changes tolocal memory
#1250, #448 - Set a
field Content Type
in a Multi-Part Form Request #1482 - Enable Resource field for OAuth Password grant type #1479
- Clear URL Autocomplete History #1484
- Update CLI to
v1.12.0
Bug Fixes
- Error when sending request: ENOENT: no such file or directory #1483
Autocomplete Environment Variables
- The extension will automatically complete the environment variables as you start typing
{{
.
![Screenshot 2024-02-26 at 12 36 56](https://private-user-images.githubusercontent.com/8637550/307788490-839b9bb9-d49e-4033-a3ce-7111db219ac1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NjA4NjAsIm5iZiI6MTczODk2MDU2MCwicGF0aCI6Ii84NjM3NTUwLzMwNzc4ODQ5MC04MzliOWJiOS1kNDllLTQwMzMtYTNjZS03MTExZGIyMTlhYzEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMjAzNjAwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MjE0MjYwYjE1NjM4OGVlMGMxN2E5ZjkwYWUzZTJhMzk1NjQ0OTU5ZmQ1YTlkZTYxYWQ2MmZmN2U2ZTA4M2NkZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.NzIgS6vyyb8-EljyxWIF9H5YtUxq7QAb2xi3cUSzg0c)
Skip Folder in Run Collection
- Now, you can use the
Skip Folder
option to skip multiple requests in the Run Collection view.
![Screenshot 2024-02-26 at 12 47 41](https://private-user-images.githubusercontent.com/8637550/307791894-2198b674-e6c9-4d1d-b1a4-2832ef806f66.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NjA4NjAsIm5iZiI6MTczODk2MDU2MCwicGF0aCI6Ii84NjM3NTUwLzMwNzc5MTg5NC0yMTk4YjY3NC1lNmM5LTRkMWQtYjFhNC0yODMyZWY4MDZmNjYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMjAzNjAwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDU3ZTJmZWI1YTkxNmEzOGVhM2Q0YmI3MzM3MjU1NzFjMjY1ZDY5YzVjYjE4NzE0YWIyOGJjY2U4Zjg2ZWI1YyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.gL51FsJxkyngptq93xhCaw6m8nbsrbM4A3IoikvThf4)
Skip Collections in Run All
- Now, you can skip collections when running all collections from the CLI.
- e.g
tc --col all --skip "ColA,ColB"
Active Environment Selection
- Set
Active Environment
selection changes tolocal memory
using the setting. This helps to avoid creating unnecessary Source Control activity.
![Screenshot 2024-02-26 at 13 20 40](https://private-user-images.githubusercontent.com/8637550/307805655-82641900-64a8-4fc1-91af-861aa9ebd4bc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NjA4NjAsIm5iZiI6MTczODk2MDU2MCwicGF0aCI6Ii84NjM3NTUwLzMwNzgwNTY1NS04MjY0MTkwMC02NGE4LTRmYzEtOTFhZi04NjFhYTllYmQ0YmMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMjAzNjAwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YmJjYzA0MWM5ZjFmNWZmOGJmMGUyMGVkODM3YTVkMDE1NjUyNzFmMDU2YmQ5MzZmMTcwZWI0YzU3MDhiNDRhNyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.Myka9M3VOLiP7xW6S6pR0uz9x7ylC1BqxGFBj5gxsdc)
Set Field Content-Type
- Set a field Content Type in a Multi-Part Form Request by appending
content-type
to the field names
![Screenshot 2024-02-24 at 17 39 52](https://private-user-images.githubusercontent.com/8637550/307539995-4c7e1012-6175-4298-837c-42b9c9a412b5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NjA4NjAsIm5iZiI6MTczODk2MDU2MCwicGF0aCI6Ii84NjM3NTUwLzMwNzUzOTk5NS00YzdlMTAxMi02MTc1LTQyOTgtODM3Yy00MmI5YzlhNDEyYjUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMjAzNjAwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NmIwMDE1YTMxM2VhMWEzYWFjNzkwYWVkYmEzNTM2ZDZmN2Y2MjQxY2RjZjc0OWI0ZTk4MTU5NjY1NzY2MDdjNSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.EwBzGbJXRzY98LFSUK1KTMxeWT1nBBQfwdQyB11GiNo)
Clear URL Autocomplete History
- You can clear the URL autocomplete history from the
Request URL
field.
![Screenshot 2024-02-26 at 12 56 28](https://private-user-images.githubusercontent.com/8637550/307794239-a77523c4-ff3b-4321-b810-2b9cf38fb778.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NjA4NjAsIm5iZiI6MTczODk2MDU2MCwicGF0aCI6Ii84NjM3NTUwLzMwNzc5NDIzOS1hNzc1MjNjNC1mZjNiLTQzMjEtYjgxMC0yYjljZjM4ZmI3NzgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMjAzNjAwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MjQ0ZTFlZDNkM2U1YjQ4ZTljMzIxZTJjNTdlOWYzOTQyYWM3NDUwMzdjNGUxMDU4NzUxZjE4NmJkOWQ3NTAyYyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.zZkFG1YCMymke5razFR-jGkTlY4J12r_jnyWxcsUs1E)
v2.17.5
New Features
- New
await tc.retryRequest()
function added totc
API - New
DNS Test
command added to Command Palette. - DNS resolve issues fixed for localhost
- Update CLI to
v1.11.6
Bug Fixes
- Special characters get converted incorrectly in cURL import functionality #1472
- JSON Schema for Schemavalidation gets Error in CI #1471
Retry Request Function:
- New
await tc.retryRequest()
function added suitable for retrying same request when failed - Use example code below for retry request in
Post Request script
let incrementCount = parseInt(tc.getVar('incrementCount') || "0");
let code = tc.response.status;
if(incrementCount <= 3 && code !== 200)
{
incrementCount = incrementCount + 1
tc.setVar('incrementCount', incrementCount)
console.log("retrying request", incrementCount);
await tc.delay(incrementCount * 1000); // exponential delay of 1 secs
await tc.retryRequest();
}
else
{
tc.setVar('incrementCount', 0);
console.log("reset incrementCount = 0");
}
DNS Test command
- use
DNS Test
command for localhost connection issues
![Screenshot 2024-02-03 at 13 22 32](https://private-user-images.githubusercontent.com/8637550/302038891-0a169c93-c781-4bb4-92b5-d7f651738ad0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NjA4NjAsIm5iZiI6MTczODk2MDU2MCwicGF0aCI6Ii84NjM3NTUwLzMwMjAzODg5MS0wYTE2OWM5My1jNzgxLTRiYjQtOTJiNS1kN2Y2NTE3MzhhZDAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMjAzNjAwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NDAyYmQzMmM5NTk1ZDAyNDYyYTUxMDU0NDQ3NTdkNzA4YmU0NWZkMGU3ZjdlYWQ5MjNkOGNhNzZhOTkyNDQ1OSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.51FXGGLeP1dxkyPeeauzk_83OKyVio8s4xYypXnigYk)
v2.17.2
v2.17.0
New Features
- Add Support For
Responses Visualisation
(Beta) #511 - VS Code setting for
default values for Request Headers
#845 - Allow to open multiple Run Collection tabs #1410
- Consolidate iterations in reports to one table structure. #1412
- Option to specify number of iterations from CLI #1411
Bug Fixes
- Response color highlighting disappears after closing and reopening the editor tab #1438
- Duplicate IDs in JSON after duplicating requests #1435
- OAUTH2 Access token breaks on all versions higher that 2.14.1 #1439
Response Data Visualisation (Beta)
- Create charts or tables from response using
tc.chartHTML()
from the Tests tab scripting - When you pass data to function
tc.chartHTML(templace, data)
, the data is available inchart_data
global variable - The feature is in Beta, please test and let us know feedback
var template = `
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.7.8/handlebars.min.js"></script>
<div id="output"></div>
<script id="entry-template" type="text/x-handlebars-template">
<div class="entry">
<h2>{{first_name}}</h2>
<div class="body">
{{email}}
</div>
</div>
</script>
<script>
var source = document.getElementById("entry-template").innerHTML;
var template = Handlebars.compile(source);
document.getElementById("output").innerHTML = template(chart_data[0]);
</script>
`;
var data = tc.response.json.data;
tc.chartHTML(template, data);
Default Headers
- You can now set default headers for requests using setting
thunder-client.defaultHeaders
![Screenshot 2024-01-03 at 16 39 43](https://private-user-images.githubusercontent.com/8637550/293974795-63d278f0-5d3c-47ff-9976-82a5abf92359.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NjA4NjAsIm5iZiI6MTczODk2MDU2MCwicGF0aCI6Ii84NjM3NTUwLzI5Mzk3NDc5NS02M2QyNzhmMC01ZDNjLTQ3ZmYtOTk3Ni04MmE1YWJmOTIzNTkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMjAzNjAwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YWVhMmY3NTI3ZjUzMTM4YjZhYWRkMjQyMWVkMTEzOWFjOWQzOWU0M2IzMDcwNGQyYzc2OWYzNDRlZjk5MDkxZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.0Mn0_-nCvqmC2JFAS3jPUX6OViRuag3Dh_dREOHUNEs)
v2.16.0
New Features
- Import functions from other js files in Scripts #1401, #920
- Skip individual requests option during collection run from Scripts #1402
- Change default http library to Axios
- Update CLI to
v1.10.0
Bug Fixes
- Automatically refresh the Auth token does not work. #1386
Import Functions from js files
- Now you can import functions from other js files. Useful for code re-use and check-in to your git repo.
- The path should be relative to workspace if you use Git-Sync, otherwise use full-path.
- You can right click on the file and choose
Copy Path
orCopy Relative Path
accordingly
// test-import.js file
function helloWorld(){
return "hello world";
}
module.exports = {
helloWorld
}
- From request Inline script import js file using
require
var {helloWorld} = require("thunder-tests/test-import.js");
var result = helloWorld();
console.log(result);
- You can also save the path in the
Environment variable
, so you don't have to change the path in every request if you move the file to different folder.
var scriptPath = tc.getVar("scriptPath");
var {helloWorld} = require(scriptPath);
var result = helloWorld();
console.log(result);
Skip Request from Scripts
- To skip request use the below function. Useful to control the execution order of the requests in Run Collection.
tc.skipRequest("requestId");
v2.15.3
v2.15.0
New Features
- Run Collection
Parallel
#1088, #1363 - Run Collection
Skip request
feature - Cookie Manager View #142
- Get the current active environment name in the inline script? #1385
- CLI - update to latest version
v1.9.0
Bug Fixes
Run Collection Parallel (beta)
- We are releasing a new feature to support running requests in collection concurrently.
- You can configure no of concurrent requests to execute in parallel.
- The feature is in
beta
, please test and let us know the feedback - CLI - use
--concurrent
switch. e.g:tc --col "colName" --concurrent 5
![Screenshot 2023-11-01 at 08 11 10](https://private-user-images.githubusercontent.com/8637550/279614713-07735856-07c5-453f-be3e-554a3f5f08df.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NjA4NjEsIm5iZiI6MTczODk2MDU2MSwicGF0aCI6Ii84NjM3NTUwLzI3OTYxNDcxMy0wNzczNTg1Ni0wN2M1LTQ1M2YtYmUzZS01NTRhM2Y1ZjA4ZGYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMjAzNjAxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9M2MzZjM1YWIzYzQwMWQ3YzA1YjQ0YzBjZDczOTRiMzJiZDc0ZTFmYzM0OWY5OWMyZTBlNjNjZGU2N2RiZmIxMiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.wxk1k4I86hNIcGVK97UpoDvRNd1Ac6viXns2X6t0UGI)
Skip Request in Run Collection
- Now you can skip request from execution in Run Collection
- Works from Extention UI and CLI
![Screenshot 2023-11-01 at 08 13 58](https://private-user-images.githubusercontent.com/8637550/279615282-743795ac-bdae-44e8-8e08-9606735ef80f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NjA4NjEsIm5iZiI6MTczODk2MDU2MSwicGF0aCI6Ii84NjM3NTUwLzI3OTYxNTI4Mi03NDM3OTVhYy1iZGFlLTQ0ZTgtOGUwOC05NjA2NzM1ZWY4MGYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMjAzNjAxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YWQxZjYyZjc2ODI0MThkZGYwM2NlOTg2ZGRkMzY5M2RlZjMwNTRlN2NkMmViMDlhN2MwNjY0ZTRjMjcyYzJjZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.PEzNVZOiRTf84Nkv-2ja9CIRt5ur__VdEZVE0DAxLPA)
Cookie Manager (beta)
- View all the cookies in Cookie Manager for the domains. You can delete single cookie or all cookies
- Limitation: Currently you cannot create cookies from Cookie Manager, instead use the Cookie header
- To view Cookie Manager:
- From
Sidebar View
-> click...
and select Cookie Manager - From
Command Palette
-> search Cookie Manager
- From
![Screenshot 2023-11-01 at 08 21 09](https://private-user-images.githubusercontent.com/8637550/279616673-1833e0ff-6a32-4707-b7e1-1bcc86a78ff3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NjA4NjEsIm5iZiI6MTczODk2MDU2MSwicGF0aCI6Ii84NjM3NTUwLzI3OTYxNjY3My0xODMzZTBmZi02YTMyLTQ3MDctYjdlMS0xYmNjODZhNzhmZjMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMjAzNjAxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YjczZmZkYTBlYzcyNzMyZTRiMTRhYmRhMmRmMjk2ZjY1ODJlNzM0OTBjZGRmYjNlNDFjYWQ4ZTllNDU2ZmVhZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.p73A0WCHiX63FLkDPRZlDQSqg6d_iEVM9Iq2Xj_g4-w)
v2.14.1
New Features
- Clear Cookies for select requests from scripting #1379
- See updated
tc
API types file (v1.6.0) - Update CLI to v1.8.1
Bug Fixes
- Fix - HTTP Headers (raw format) does not retain the unselected headers #1382
New API for Cookies
- We are adding a new API to manage cookies from scripting
Get Cookies
// get all cookies in store
var list = await tc.getCookies();
// get all cookies for current url
var listDomain = await tc.getCookies("url");
var listDomain = await tc.getCookies(tc.request.url);
Clear Cookies
// clear all cookies in store
await tc.clearCookies();
// clear all cookies for current domain
await tc.clearCookies("url");
await tc.clearCookies(tc.request.url);
// clear single cookie by name of cookie
await tc.clearCookies(tc.request.url, "cookieName");
Set Cookie
// set cookie for current url
await tc.setCookie("https://www.thunderclient.com", "cookieName", "cookieValue");
await tc.setCookie(tc.request.url, "cookieName", "cookieValue");
v2.14.0
New Features
Inline Scripting
support #1026- Col & Request level env variables using scripting #823
- CLI - Single report for test run with multiple collections #1221
- chai
expect
,assert
, andatob
,btoa
global variables added in scripting. - Update CLI to version
v1.8.0
Bug Fixes
- Cannot view/edit long environment variable values #1378
- CLI - Pipeline job success if no collection is running #1376
Inline Scripting
- We are introducing an inline scripting feature. Now you can use scripting for advanced use cases right inside Thunder Client views.
![inline-scripting](https://private-user-images.githubusercontent.com/8637550/276702439-e09eb42a-66b9-4643-b148-47df110d7f39.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NjA4NjEsIm5iZiI6MTczODk2MDU2MSwicGF0aCI6Ii84NjM3NTUwLzI3NjcwMjQzOS1lMDllYjQyYS02NmI5LTQ2NDMtYjE0OC00N2RmMTEwZDdmMzkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMjAzNjAxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NjBlMWU4MTFiY2QxN2Y3NmMxNGRmNzk5OGIwYzE3NjIxMTNlMjNkNTUyZmY4NjA1YzMyZjkyOTNhMWVkZGViZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.RZF0FH83oBEXNPbc43uyffva6bHE5mldMJ6XjOfxXHM)
Collection and Request Variables
- Now you can use collection and request variables with
request
scope from the scripting
![collection-variables](https://private-user-images.githubusercontent.com/8637550/276705285-cf06dea9-1413-4949-a3ab-a841c9dc54c9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NjA4NjEsIm5iZiI6MTczODk2MDU2MSwicGF0aCI6Ii84NjM3NTUwLzI3NjcwNTI4NS1jZjA2ZGVhOS0xNDEzLTQ5NDktYTNhYi1hODQxYzlkYzU0YzkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMjAzNjAxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZmU2MWUyZTM2MzUwZTVjZWJhMWFmZTFmMTVmY2Q3MmYzYzIwMGM3NGMzNWFhMDY2ZWRmMmZiNjI0NWI3YmQ1MSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.zutaPHtgLgJ2nIjaedk3QsPVEDI0bt7JnhfN0zXOrN8)
Global Variables
- We added new global variables useful in scripting
- Chai
expect
andassert
functions are now global variables atob
andbtoa
are global variables useful for base64 encoding and decoding
OLD way to use chai library
const chai = require("chai");
var expect = chai.expect;
var assert = chai.assert;
tc.test("Chai - Response code expect to be 200", function () {
expect(tc.response.status).to.equal(200);
})
NEW way of using global variables
tc.test("Chai - Response code expect to be 200", function () {
expect(tc.response.status).to.equal(200);
})
New API for Cookies in v2.14.1
- We are adding a new API to manage cookies from scripting
Get Cookies
// get all cookies in store
var list = await tc.getCookies();
// get all cookies for current url
var listDomain = await tc.getCookies("url");
var listDomain = await tc.getCookies(tc.request.url);
Clear Cookies
// clear all cookies in store
await tc.clearCookies();
// clear all cookies for current domain
await tc.clearCookies("url");
await tc.clearCookies(tc.request.url);
// clear single cookie by name of cookie
await tc.clearCookies(tc.request.url, "cookieName");
Set Cookie
// set cookie for current url
await tc.setCookie("https://www.thunderclient.com", "cookieName", "cookieValue");
await tc.setCookie(tc.request.url, "cookieName", "cookieValue");
Planning to Deprecate/Retire Features
Attach Env to Collection
- How many users are using this feature? Now we have collection and request level variables using scripting, is the Attach Env to collection still useful?
- Please let us know your feedback here
![Screenshot 2023-10-19 at 19 37 38](https://private-user-images.githubusercontent.com/8637550/276716893-428afcb3-d3df-496a-b6e6-24a76c208987.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NjA4NjEsIm5iZiI6MTczODk2MDU2MSwicGF0aCI6Ii84NjM3NTUwLzI3NjcxNjg5My00MjhhZmNiMy1kM2RmLTQ5NmEtYjZlNi0yNGE3NmMyMDg5ODcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMjAzNjAxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NGJhMmEyZGEyZmMyMGY2ZjRiNDUxMDVjNWUxNDE0OTE3ZDJhZWQ0NDAwOGZlOGY0ZGJhMDc5MGIyNmViNWZhYyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.MxiOCHoGKMp5hpQai0VZxvrUVU1rFFO4AyxLZPm9e14)