Highlighted
Absent Member.. Absent Member..
Absent Member..
178 views

Write multi user data to a .dat file

Hi All,
5Vusers with 'x' iterations creating reservations.
Extracted reservation confirmation numbers through correlation.
We wanted to store/write confirmation numbers
for checkout reservation of running end of day process.

Any suggessions or solutions is appreciated.

Regards,
Ugandar .E
0 Likes
6 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..

Hi Ugandar, Multi user data logging will be trouble some at times by file writing operations.

The supported approach for such operations is to use VTS. You can refer the complete information guide for that here.

http://support.openview.hp.com/selfsolve/document/KM450195

-Raj

Regards,
Raj

Like this Post? Click Kudos! to show appreciation.
Is your issue addressed? Click "ACCEPT AS SOLUTION" against the post which helped you the most.
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

If you wish to use direct file logging only & test if it is perfectly suites your neeed, then it is to be handled by simple C code.

Please use the below code for your operations & replace the relevant variables.

long file;
char *filename="c:\\confirmation.txt";
char *vuser;

vuser = lr_get_vuser_ip();

/* Open the file with read access */

if ((file = fopen(filename, "a+")) == NULL ) {
lr_error_message("Unable to open %s", filename);

return -1;
}

fprintf(file,"vuser: %s Confirmation Number :%s",
lr_eval_string("{vuser}"),lr_eval_string("{confirmation_number}"));
/*Close the file*/
fclose(file);

return 0;
}

Let me know if this helps you.

Thanks,
Raj

Regards,
Raj

Like this Post? Click Kudos! to show appreciation.
Is your issue addressed? Click "ACCEPT AS SOLUTION" against the post which helped you the most.
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Thanks, Raj for your suggessions.

We tried similar code to wrote .dat file.
It is working fine.

After running End of day process.We wanted use those stored confirmation numbers to check out the guest.

We created confirmation parameter and pointed to created .dat file.

During run time Confirmation parameter is not reading the confirmation number from the .dat file.

Any suggessions?

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Ok Ugandar,

If you need to reuse the stored variable at the end of the day, then VTS is the perfect solution for you.

Because, if you are running the EOD script within the same scenario, then the loading of the parameter file will be in morning & cannot load the variable loaded till EOD.

If you are running the script separately, then you may need to ensure the following (Please confirm if you have verified this).

1. The first line has to be file name
2. You need to use the \n operand while writing the file output operation at the end of the variable.
3. There should be a blank line at the end of your parameter file.
4. The location of the parameter file has to be accessible for both the scripts.


After you ensured all these, please let me know what issue you are facing. Try loading this file manually in a test script & see if you found any issues.

-Raj

Regards,
Raj

Like this Post? Click Kudos! to show appreciation.
Is your issue addressed? Click "ACCEPT AS SOLUTION" against the post which helped you the most.
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Raj,
Scenario:-
5Vusers x 20iterations then 1 VUser doing eod process then all 5Vusers doing checkout.This process has to repeat for 3 days.All has to done in one scenario.

I explored VST. we created confirmation column and writing confirmations numbers to vts tables during run time.

But we are facing once issue.

How to get numbers from Confirmation column uniquely for all user simultaneously doing checkout.


any suggessions or approach is appreciated.


0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Hi Ugandar,

I am not well versed with VTS till now, but I suppose you should use the following command to retrieve data from specific column.

rc = vtc_query_column(pvci, "Col1", 1, &value);

In the place of 1 you need to define a variable which points to a unique row number. Likely that define a parameter which moves to next row for every occurrence.

Read the complete manual & read the example scripts & you will be master of it by practicing it.

-Raj

Regards,
Raj

Like this Post? Click Kudos! to show appreciation.
Is your issue addressed? Click "ACCEPT AS SOLUTION" against the post which helped you the most.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.