1

How to generate the auth bearer token ,that going to be use in Performance tests script. I need to pass the dynamic value of token in the response header of payment.sandbox, braintree graphql request. But I am no where getting the value of token

Please give solution in regard to Jmeter tool or performance script. Else if some code of lines are required to generate the token or need to use beanshell sampler or jsr223, then please explain in detail

Thanks in Advance

1 Answers1

0

The docs say:

  1. Log into either the production Control Panel or the sandbox Control Panel, depending on which environment you are working in
  2. Click on the gear icon in the top right corner
  3. Click API from the drop-down menu
  4. Scroll to the Tokenization Keys section

You would then ammend your Request header to add the Authorization Bearer. Here's a TypeScript Apollo example:

this.apollo.create({
  cache: new InMemoryCache(),
  link: new HttpLink(this.http).create({
    uri: `https://${environment.braintree.url}`,
    headers: new HttpHeaders().set('Authorization', `Bearer ${environment.braintree.token_key}`).set('Braintree-Version', `2020-06-21`)
  })
}, 'braintree');
kneeki
  • 2,444
  • 4
  • 17
  • 27
  • Using below code to skip the braintree token, but getting following error Added some code in JSR223 SAMPLER beginning with But in JSR233 SAMPLER ,getting following error Response code:500 Response message:javax.script.ScriptException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script8.groovy: 1: unexpected token: < @ line 1, column 1 What's the solution ? – Manav Chopra Jun 29 '20 at 08:16