Hello @moorthi_raj
Thanks for your comments, I tried with
pm.expect(0).to.eql(pm.globals.get(1));
but, I am still getting the AssertionError: expected 0 to deeply equal undefined, as message.
Hello @moorthi_raj
Thanks for your comments, I tried with
pm.expect(0).to.eql(pm.globals.get(1));
but, I am still getting the AssertionError: expected 0 to deeply equal undefined, as message.
Hi @Raja2242
If the error is coming as ‘undefined’ means,
then log the values of the variable you are getting globally as,
console.log(pm.globals.get(1)); //should show the respective value
But we will save the a value globally as a variable right! So could you provide the variable name to call there like,
console.log(pm.globals.get(“variableName”));
I tried in my end and advising this. Please check and let me know if you have any issues.
Hello,
I have an issue with a test. I am looking to check the length of element “skuId”
{
“order”: “A1822”,
“style”: “VQ35”,
“detail”: [
{
“Area”: “ITALY_FRSE”,
“skuDetail”: [
{
“skuId”: 119406,
My test looks like that:
let jsonData = pm.response.json();
jsonData.detail[0].skuDetail.forEach(function(article) {
console.log(article.skuId);
pm.test(“Body matches string”, function() {
pm.expect(6).to.eql(article.skuId.length)});
});
==> I am getting this error "
Body matches string | AssertionError: expected 6 to deeply equal undefined"
Any help would be highly appreciated !
@bpricilla Hello I Have Issue with a test. I need help . AssertionError: expected 2089 to deeply equal ‘2089’
pm.test(“Search By Customar Id”, function () {
var jsonData = pm.response.json();
pm.expect(jsonData.user.id).to.eql(pm.collectionVariables.get(“id”));
console.log(pm.collectionVariables.get(“id”))
});