jeudi 7 janvier 2021

Robot Framework: How to avoid a variable value from being displayed in the console during execution

I have the API Key to a server available in clear text in our tests. To avoid this i came up with a new python script Secure.py (This includes 'encrpyt' and 'decrypt' functions) and its working fine.

I have a decrypt keyword in my robot tests.

Variables

${secret_phrase} abcdefghij
${encrypted_Key} ardfvbjgfrtavhdimdbshajakiugbn #I have used a secret phrase and the api key to encrypt and this is the encrypted key.

Test Cases

decrypt ${APIKEY} Secure.Decrypt ${secret_phrase} ${encrypted_Key} strong text# APIKEY result is printed in the console. Should Not Be Empty ${APIKEY} shell=no Set Suite Variable ${APIKEY} shell=no

In this keyword i am passing in secret phrase and encrypted key so as a result i get the APIKEY.

#APIKEY result is printed in the Console, I don't want it to be printed in the console is there any way to do so?

Console: ${APIKEY}= asdfghjkl

Aucun commentaire:

Enregistrer un commentaire