Background:
I want to confirm at the interface level whether the new application can be found after it is successfully added. I don’t think it’s troublesome to write a query interface alone, so I write the query interface into the tests of the new interface. I want to do the assertions of whether the new application can be queried after the new application is successful in the tests of the new interface. Code directly skip, the following first on the execution results.
Implementation results:
Summary:
my assertion failed, but when I checked the global variables set, I found that the global variables have been set successfully. But using pm.globals.get (“chartappname1”) when taking this value, the value taken out is inconsistent with what you see…. After checking the code repeatedly, no error was found. Finally, I consulted a senior. The senior told me that the global variable set in tests will take effect only after the interface is executed. I immediately understood that my assertion is executed during the interface execution. Therefore, the value I took when I made the assertion is not updated. As for why the corresponding value has been changed when I checked it Update, because even if my assertion fails, the interface completes the corresponding request.