Forum Discussion

mini84's avatar
mini84
Occasional Contributor
11 months ago

Adding a property variable in Access Token field returns invalid token.

Hi,

i'm using Soapui open source version 5.7.2

  1. I have a TestSuite1 with TestCase1  with a Request1 called login.
  2. After login i have a property transfer which retrieve the token and store it in a testsuite property called "test".
  3. I have a TestSuite2 with a TestCase2 with a Request2 called get_information, this request need the login token obtained in Resquest1 from the testsuite property "test"

 in Request2 set an Authorization Bearer with Acces Token,

in the Access Token field i wrote $(#TestSuite#test)

When i run TestSuite1 the login token is transferred in $(#TestSuite#test) 

When i run TestSuite2 the Request2 it returns 401 error : Token is invalid or expired

If i run replace $(#TestSuite#test)  the token value directly in Access Token field then the test is passed.

Question:

Why the Request2 returns error when im using the $(#Project#token) in Access Token field ?

I need to use the token in all request and the token is changing every minute.

Any help please?

Thank you 

  • mini84's avatar
    mini84
    Occasional Contributor

    I did the same test in postman and it works, the bearer token is retrieved.

    • nmrao's avatar
      nmrao
      Champion Level 3

      No one asks for your project, just simulate the test using the same structure as you are using to reproduce the issue.