Katalon throwing error as 405 when sending variable in url
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
How to overwrite value in global variable in Testcase ? Does it work at Testsuite level overwriting of Global variable. ?
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.
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
- Generate Itemid (gave me itemid and many more in json)
- I am saving that response value on fly to guid(yes to global variable)
- Get that guid value from previous request (generateitem) passed in url
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
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 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"
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)