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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...