LoadRunner Support Forum
Showing results for 
Search instead for 
Do you mean 

how to pass the value of a parameter into a table/file

SOLVED
Go to Solution
Highlighted
Frequent Advisor

how to pass the value of a parameter into a table/file

guys,

 

lets say i want to capture a lot of this

Notify: Parameter Substitution: parameter "TOKEN_val" =  "AQIC5wM2LY4Sfcz-aXnMTKaEHi1wmVOH8ZZOtufHVk0dMps.*AAJTSQACMDQAAlMxAAIwMg..*"

 

into another file so that i will be able to use that to another script as an input

 

i already know how to get the token i just dont know how to SAVE it to a file/parameter so that i will just copy the file.dat

to another script

 

 

thank you in advance

1 ACCEPTED SOLUTIONS
Respected Contributor

Re: how to pass the value of a parameter into a table/file

Hi pistolero,

Please find the below example.

vuser_init()
{
int i = 100;
char c = 'C';
float f = 1.234;
return 0;
}

Action()
{

int i = 100;
char c = 'C';
float f = 1.234;
long file;
char * filename = "C:\\Files\\Srihari2.txt";
// Create a new file

if ((file = fopen(filename, "w+" )) == NULL) {
lr_output_message("Unable to create %s", filename);
return -1;
}
fprintf(file, "%d %c %f", i, c, f);
fclose(file);
}

Regards,
Srihari
2 REPLIES
Respected Contributor

Re: how to pass the value of a parameter into a table/file

Hi pistolero,

Please find the below example.

vuser_init()
{
int i = 100;
char c = 'C';
float f = 1.234;
return 0;
}

Action()
{

int i = 100;
char c = 'C';
float f = 1.234;
long file;
char * filename = "C:\\Files\\Srihari2.txt";
// Create a new file

if ((file = fopen(filename, "w+" )) == NULL) {
lr_output_message("Unable to create %s", filename);
return -1;
}
fprintf(file, "%d %c %f", i, c, f);
fclose(file);
}

Regards,
Srihari
Valued Contributor

Re: how to pass the value of a parameter into a table/file

For your requirement use VTS concept which will have control across the test users. In 11.50 VTS integrated as a internal component.

 

Let me know if you need any help on this.

 

Thanks, Ajay