Highlighted
Absent Member.. BCollins Absent Member..
Absent Member..
772 views

Question regarding use of .csv file with data constraints

I apologize in advance if I do a poor job explaining this, but here goes:

I am looking at scripting a test where managers are logging in and approving timesheets for employees. I have several hundred managers with roughly 3500 employees total. 

Currently, the full listing has each manager and their login listed with each employee they manage beside them (each manager has between three and thirty assigned employees), and this is where my problem comes in.

For simplicities sake, lets say I have:

 

Manager A - Employee 1

Manager A - Employee 2

Manager A - Employee 3

Manager B - Employee 4

Manager B - Employee 5

Manager B - Employee 6

 

so on and so forth. What I need is a way to ensure that each manager is only signed in once (eg, a virtual user picks a manager, signs in, then uses the associated employee information to find and manage the employee) without two or more virtual users trying to use the same manager login.

 

Is there a way to make sure that each unique manager login is in use only once, even if it shows up multiple times within the data file? The only other option I can think of is to have a script and corresponding data file for each manager, and that would become rather bloated very quickly.

 

Thanks!

0 Likes
1 Reply
arkaonline
New Member.

RE: Question regarding use of .csv file with data constraints

Simple solution is

You need to have 2 datafiles...
1 for Managers and 1 for Managers and Employees..

1st data file should read

ManagerA
ManagerB
ManagerC

2nd datafile should read

Manager A - Employee 1
Manager A - Employee 2
Manager A - Employee 3
Manager B - Employee 4
Manager B - Employee 5
Manager B - Employee 6

Next , call and fetch login id as sUser from tinit to ensure 1 time login for each Manager..
once in TMain ,

call and fetch sManager and sEmployee from 2nd datafile..

Next Check

if sManager = sUser then
approve employee;
fetch next row;
else
fetch next row;
end;

it would be smoother if Number of Users = number of unique managers...

Let me know , if any questions.....
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.