Jump to content
WAPT Forum
Sign in to follow this  
mjones

Wanting to cut and paste data from a page being recorded

Recommended Posts

I'm attempting to cut and paste a variable value from a web page that changes between executions. After recording, the value that is recorded is listed as static text. E.g. I cut and paste a value that is 100 during the recording of the script into a search box on the web page. During run time the value may be 50. I want to put the value of 50 (or whatever it is at run time) into the search box. However, each run of the test puts the value of 100 into the search box.

 

How can I make that data that I cut and paste change with each execution of the script?

 

Thanks

Share this post


Link to post
Share on other sites

Initially when you record a profile for virtual user, all parameters are recorded as static values. However you can change that and make them dynamic. For this purpose you can use internal WAPT functions. With help of them you can accomplish two tasks:

 

1. Make values of some parameters different for each user session.

2. Extract values from server response (within a user session) and reuse these values in the subsequent requests.

 

You can find more information about that here:

 

http://www.loadtestingtool.com/help/working-with-session-variables.shtml

http://www.loadtestingtool.com/help/parameter-value-dynamic-calculation.shtml

 

We also have a demo clip showing step by step how to perform the parameterization. You can download it here:

 

Part 1: http://www.loadtestingtool.com/quickstart/WAPTdemo-part1.avi

Part 2: http://www.loadtestingtool.com/quickstart/WAPTdemo-part2.avi

Share this post


Link to post
Share on other sites

Follow on question.

I have recorded a test that grabs a value from a URL as a variable that I use to replace a URL parameter on a subsequent page, When I run it as a short test and only taking it to the point of replacing the value it works. However, when I use this as part of a larger test I receive a message that the URL is too large. The variable does the following search: $Search(?docId=,&re,1) which I then include on the page where I need to use that value; calling it as an autosearch variable.

 

Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×