We cannot access variables which made in @testSetup method at @isTest method.
The example is shown as below.
The solution is to select the test data by using SOQL again.
Failed to save quote. Please try again later.
You cannot quote because this article is private.