Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8559807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:08:20+00:00 2026-06-11T16:08:20+00:00

I may be going about this in the completely wrong way, but how do

  • 0

I may be going about this in the completely wrong way, but how do I pass a dynamic variable to a bunch of requests within the same testsuite in SoapUI?

My first test step is a Groovy script. I need to generate a random account name, and then use it in all my other requests. There are about 20 other requests. I initially thought I could just loop the testsuite, but it is not working.

This is my groovy script at the beginning:

Random random = new Random()

def randUserAccount = "testAccount" 

int max = 100000
randnum = random.nextInt(max+10000)

randUserAccount += randnum

log.info "     Creating account: $randUserAccount"

Then in each request step, I have things like this:

<ns:CreateAccountRequest>
    <accountID>${randUserAccount}</accountID>
...

or

<ns:PurchaseRequest>
    <accountID>${randUserAccount}</accountID>
...

The account is null when I actually send it, and of course that gives errors on the server side. How do I really get the variable to persist across all the requests in the testsuite?

Thanks in advance for any hints!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T16:08:21+00:00Added an answer on June 11, 2026 at 4:08 pm

    You can use the context, I believe. You can definitely use it between requests in a test, but I also think it will work between tests in a suite.

    context.setProperty("randUserAccount", randUserAccount)
    

    Then use the syntax you specified in the actual requests.

    Let me know if this doesn’t work. You can also use ‘properties’ to do this, but it is a little more work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to Python so I may be going about this completely wrong, but
This may be super simple - but I'm struggling to spot what's going on.
This problem may be a little broad, but I'm going to go ahead and
So, this question may be a little vague, but I have constant discussions about
I may be going about this backwards... I have a class which is like
This may sound like noobish question but I have tried researching these two classes
I am going to create a web site or you may call it a
Simple question, the answer may not be... I'm going to be developing a web
May I know how could I pass the value of driver from code behind
May I know a way to change the Google Map marker color via Javascript..

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.