Forum Discussion
KeyofSea123
12 years agoContributor
I actually got the map and list working a couple of days ago - using what you suggested. :-)
Sometimes I have an email address in my Excel spreadsheet and sometimes I generate a random email address. This is part of my Groovy script that runs just prior to the REST POST step.
if (email.length() > 1)
{
testRunner.testCase.setPropertyValue( "Email", email )
}
else
{
email = startDate.format("'Email'yyyyMMddHHmmss") + "@" + randomEmailAddresses[new Random().nextInt(3)]
log.info email
email = java.net.URLDecoder.decode(email, 'UTF-8')
testRunner.testCase.setPropertyValue( "Email", email )
}
The result (the REST POST request) looks like this:
message_topic_application=Testing&party_name=First2013_04_17T15_01_00_941Last2013_04_17T15_01_00_941&country_code=US&email_restriction=DO_NOT&last_name=Last2013_04_17T15_01_00_941&county=KING&address1=150100941Lane20130417&phone_restriction=DO_NOT&first_name=First2013_04_17T15_01_00_941&direct_mail_restriction=DO_NOT&email=Email20130417150100%40gmail.com&postal_code=98101&city=SEATTLE®ion=WA
The email variable actually contains "Email20130417150042@gmail.com" but is converted on the way to the REST step. Therefore, it no longer is a valid email address and isn't written to the database. I've tried many solutions, including the one you sent to me, but all with the same (or worse) results.
The "err" in the REST request should be "Email20130417150042%".
How do I "force" this @ symbol into the REST POST request?
Thanks!
Sometimes I have an email address in my Excel spreadsheet and sometimes I generate a random email address. This is part of my Groovy script that runs just prior to the REST POST step.
if (email.length() > 1)
{
testRunner.testCase.setPropertyValue( "Email", email )
}
else
{
email = startDate.format("'Email'yyyyMMddHHmmss") + "@" + randomEmailAddresses[new Random().nextInt(3)]
log.info email
email = java.net.URLDecoder.decode(email, 'UTF-8')
testRunner.testCase.setPropertyValue( "Email", email )
}
The result (the REST POST request) looks like this:
message_topic_application=Testing&party_name=First2013_04_17T15_01_00_941Last2013_04_17T15_01_00_941&country_code=US&email_restriction=DO_NOT&last_name=Last2013_04_17T15_01_00_941&county=KING&address1=150100941Lane20130417&phone_restriction=DO_NOT&first_name=First2013_04_17T15_01_00_941&direct_mail_restriction=DO_NOT&email=Email20130417150100%40gmail.com&postal_code=98101&city=SEATTLE®ion=WA
The email variable actually contains "Email20130417150042@gmail.com" but is converted on the way to the REST step. Therefore, it no longer is a valid email address and isn't written to the database. I've tried many solutions, including the one you sent to me, but all with the same (or worse) results.
The "err" in the REST request should be "Email20130417150042%".
How do I "force" this @ symbol into the REST POST request?
Thanks!
Related Content
- 5 years agounderqualified
- 3 years agogoogleid_114550
- 4 years agoLee_M