Defender
15 years agoContributor
How to get the parameter value instead of path from script?
Hi all,
I have a REST request that needs to use the dynamically created header like follows:
DRIV-SECURITY-WSSE: UsernameToken Username="XXX", PasswordText="YYY"
To do this, I have created 2 PLAIN parameters UserName & PasswordText & HEADER parameter called DRIV-SECURITY-WSSE on resource level.
Also I had created several Custom Properties on Project level like ValidUserName, InvalidUserName etc.
I linked parameters with properties in such manner:
Then I wrote the Setup script on testSuite level which goes through the all test steps & builds the DRIV-SECURITY-WSSE parameter value like follows:
UsernameToken Username="${#Project#ValidUserName}", PasswordText="${#Project#ValidPasswordName}"
And there is a problem: I need to encode PasswordText value before it comes into header.
But when I use
var pwdText = curTestStep.getProperty("PasswordText").getValue();
- I get just ${#Project#ValidPasswordName} instead of its value! So that my encoding doesn't work.
Could anyone help me with this issue?
I have a REST request that needs to use the dynamically created header like follows:
DRIV-SECURITY-WSSE: UsernameToken Username="XXX", PasswordText="YYY"
To do this, I have created 2 PLAIN parameters UserName & PasswordText & HEADER parameter called DRIV-SECURITY-WSSE on resource level.
Also I had created several Custom Properties on Project level like ValidUserName, InvalidUserName etc.
I linked parameters with properties in such manner:
Then I wrote the Setup script on testSuite level which goes through the all test steps & builds the DRIV-SECURITY-WSSE parameter value like follows:
UsernameToken Username="${#Project#ValidUserName}", PasswordText="${#Project#ValidPasswordName}"
And there is a problem: I need to encode PasswordText value before it comes into header.
But when I use
var pwdText = curTestStep.getProperty("PasswordText").getValue();
- I get just ${#Project#ValidPasswordName} instead of its value! So that my encoding doesn't work.
Could anyone help me with this issue?