Contact Us
About Us
News
Home
Main Menu
Home
Eviware Store
Downloads
Products
News
Forum
Eviware Blog
Search
FAQs
Customer Area
Support
Documentation
Tutorials
CookBook
Downloads
Forum
Login Form
Welcome,
Guest
. Please
login
or
register
.
November 22, 2008, 06:55:03 am
Username:
Password:
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Forgot your password?
Dynamic (Unique) property variable in XML Request
Welcome,
Guest
. Please
login
or
register
.
November 22, 2008, 06:55:03 am
News:
The Forums are up! Welcome to eviware.
Eviware Forum
soapUI
soapUI
Dynamic (Unique) property variable in XML Request
« previous
next »
Pages:
[
1
]
Author
Topic: Dynamic (Unique) property variable in XML Request (Read 638 times)
James Grace
Newbie
Posts: 5
Dynamic (Unique) property variable in XML Request
«
on:
February 27, 2008, 10:32:34 pm »
Hi All,
The WebApp I'm testing requires a UniqueToken in the XML Request. Is there a way I can include a dynamic property variable in a XML Request?
I've tried dynamically entering a time variable in the -DsoapUI.properties=properties.txt file, but this appears to be read only at startup.
From what I can tell, Groovy script is an option before or after the Test Case is run. Not when it is run.
I don't need anything fancy, just a unique string. Something like the output from "time /t" would be fine.
Any suggestions to point me in the right direction would be much appreciated.
Thanks,
~Jim
Logged
omatzura
Administrator
Hero Member
Posts: 1,425
Re: Dynamic (Unique) property variable in XML Request
«
Reply #1 on:
February 27, 2008, 10:35:37 pm »
Hi Jim,
try adding the following to your TestCases Setup script:
context.randomId = Math.random()
And then "use" the randomId variable in a request with
<someElement>${randomId}</someElement>
Hope this helps!
regards,
/Ole
eviware.com
Logged
James Grace
Newbie
Posts: 5
Re: Dynamic (Unique) property variable in XML Request
«
Reply #2 on:
February 28, 2008, 04:30:26 pm »
Thanks Ole,
I can't seem to get this to work.
I added the context.randomId = Math.random() to the Test Case setup
and set the XML request like so, <ext:UniqueToken>${randomId}</ext:UniqueToken>
I've tried ${randomId} and ${#TestCase#randomId}. The property expansion is not happening. soapUI sends whatever I put in the UniqueToken holder.
I tried added a def before the context.randomId = Math.random(), and creating the def other ways, but can't get the property expansion to work.
I've also tried creating a UniqueToken groovy script containing the context.randomID function and using the result ni the XML request like so,
<ext:UniqueToken>${#UniqueToken#randomId}</ext:UniqueToken>
What am I missing? I can't help but think it's something simple.
«
Last Edit: February 28, 2008, 08:29:17 pm by James Grace
»
Logged
omatzura
Administrator
Hero Member
Posts: 1,425
Re: Dynamic (Unique) property variable in XML Request
«
Reply #3 on:
February 28, 2008, 09:46:24 pm »
Hi!
this solution will only work when you run the entire TestCase, not just an isolated Request inside it.. could that be the cause of your problem?
regards!
/Ole
eviware.com
Logged
James Grace
Newbie
Posts: 5
Re: Dynamic (Unique) property variable in XML Request
«
Reply #4 on:
February 29, 2008, 12:40:44 am »
I've gotten the context.randomId = Math.random() to return a value from a Groovy script Test Step, then Transfer the value (using a Property Transfer Test Step) to the final Test Step (Interactive Read <XML Request>).
I just haven't had any luck defining the Math.random() function in the Test Case Setup Script and having the Property Expansion work properly in the XML Request.
It's probably a Scope or Syntax problem on my part. I'm still learning my way around soapUI. I'll keep poking around.
Thanks much for the assistance & very nice work on soapUI. I've convinced my group to switch from soapScope and buy a few copies of soapUI. I expect to get lots time on it in the future.
Have a good day!
~Jim
Logged
omatzura
Administrator
Hero Member
Posts: 1,425
Re: Dynamic (Unique) property variable in XML Request
«
Reply #5 on:
February 29, 2008, 07:19:43 am »
Hi Jim,
ok, sounds good! Contact me once you have the pro-licenses and we can set up a webex session to sort this out (if you want)..
regards!
/Ole
eviware.com
Logged
James Grace
Newbie
Posts: 5
Re: Dynamic (Unique) property variable in XML Request
«
Reply #6 on:
February 29, 2008, 02:18:50 pm »
Excellent! Will do.
Logged
James Grace
Newbie
Posts: 5
Re: Dynamic (Unique) property variable in XML Request
«
Reply #7 on:
March 07, 2008, 04:52:32 pm »
Hi Ole,
I got our SoapUI Pro licenses yesterday. I will put together a brief description of our Web App and some of the things I want to do and email it to you.
Our Web App is not very complex and I think we can work out a lot of what I want to do with emails. If I cannot work things out after a few emails, we can go the Webex route.
Thanks much,
~Jim G
Logged
omatzura
Administrator
Hero Member
Posts: 1,425
Re: Dynamic (Unique) property variable in XML Request
«
Reply #8 on:
March 07, 2008, 05:36:08 pm »
Hi Jim,
Thank you, we're proud to have you as a Pro-user :-)
regards,
/Ole
eviware.com
Logged
Pages:
[
1
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> eviware general
-----------------------------
soapUI
-----------------------------
=> soapUI
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Powered by SMF 1.1.2
|
SMF © 2006-2007, Simple Machines LLC
Loading...