Showing 405 when passing Global variable in url GET ${id}

Katalon throwing error as 405 when sending variable in url


Globalvariable
image
Error
image

But when update the value in globalvariable it worked. (but test case also show the result for gived value not the updated variable saved in previous script by GlobalVariable.guid

How to overwrite value in global variable in Testcase ? Does it work at Testsuite level overwriting of Global variable. ?

Hehehe hello!

That global variable changes its state during the test execution?
I’m thinking about possible solutions but I need more info about what you’re trying to do first.

Cheers.

1 Like

hehehe yeww

Let say i have global variable defined as “guid” … Then my test case and suit works (since i added value in global variable to “guid”)

Now i have test case

  1. Generate Itemid (gave me itemid and many more in json)
  2. I am saving that response value on fly to guid(yes to global variable)
  3. Get that guid value from previous request (generateitem) passed in url

Simple :stuck_out_tongue: haha

1 Like

Seems like prob is in here ?

Yes, that’s the problem.
It happens because GV values don’t keep the value after the test case ends :sob:
You can find the solution here: Update GV permanently

Are you working with Jira/xray by any chance?
I’ve experienced the same exact problems than you but a week before and it drove me crazy, so I’m really trying to help because I know what it is hahahaha.

nope not jira !! but soon that will come. btw problem solved it was my code… silly me
captured the wrong value from GV …aarh!! overwriting was working …but not using the right value :smiley: hahaha didn’t review my own code lol

Ok, cool then!

Just curious, are you overwriting the GV during a single test and using it in another part of that same test, or are you changing that value during a test and then using the value in the next one? I mean, the value is persisting after a TC execution?
Because I thought you couldn’t change the value permanently if you simply do something like this:

GlobalVariable.myGlobalVariable = "susana"

Cheers!

This one.

I mean, the value is persisting after a TC execution? - Exactly If you gave the value like you did. And if you keep that value empty
GlobalVariable.myGlobalVariable = ‘’ And use it your tests. And it will be overwritten for that TestSuit (until you provide or overwrite that value in GV)

Thanks