Ask a Question

Base64 decode password


Base64 decode password

Hi All,


I have a a project property that has a password that I use in a request. In the password field of the request I use syntax below to get password in request:


This works perfect. Now I would like to use base64 encoded password and decode this password with syntax below:


But When I use this syntax I get invalid userid / password error. What am I doning wrong? How can I use encoded passwords?


Thanks in advance!

Super Contributor

Just to clarify, when you say "I would like to use base64 encoded password and decode" do you mean that the property ${#Project#servicePwd} is a Base64 encoded string and you want to convert this to plan text to send to your service, or vice versa?


As an aside Groovy contains it's own methods to encode & decode Base64 strings, you shouldn't need to use the java.util library. See the following page for details:

Exactly, I want to decode the password stored in ${#Project#servicePwd}


And thanks for the groovy tip. I will look into it.

Super Contributor

Just one more point, I was wondering why you had a Base64 encoded property? Are you just trying to obscure the password, so somebody can't just view it? If so are you aware that Ready API has several feature to protect sensitive data? I've personally never used them, but they are described on the following page:


In particular check out the section "Encrypt Individual Properties".

Yes I want to obscure the password. 

Thanks for the link, I am aware of these options. I don't want to use password protected projects (as described in the links).

Champion Level 0

I think you could get what you want with this snippet of code:


${= new String (context.testCase.testSuite.project.getPropertyValue("servicePwd").decodeBase64() )}


Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!
Showing results for 
Search instead for 
Did you mean: