Trusted Contributor.
Trusted Contributor.

Write data from a file and create a batch file in LoadRunner


I got this scenario and I want to check with you any opinion in order to create a better script.

I got the credentials to authenticate (more than 500 users) into a intranet webpage in a excel file. I must read this file, extract the username and create a batch file (it could be a .vbs file also) with a sentence to run a service with the username, not with the user I'm scripting which is actually an admin user. Once the service is running I can open the webpage and proceed with the authentication...

I was thinking to:

1. Read excel file.

2.Extract the username and password, create a .vbs file with the sentence to run the service, something like:

set oS= Wscript.CreateObject("WScript.Shell")
oS.Run "runas /profile /user:XXX\YYY  ""C:\Program Files\AAAs\Service.exe"""
oS.Sendkeys PASSWORD

where YYY is the username

3. Run this file

4. The service is running so I can launch the browser and authenticate, script continues...

I must repeat these steps for the 500 users...

Do you think is there any other better approach?


1 Reply
Trusted Contributor.
Trusted Contributor.

Any ideas, guys?

Actually, I don't think this is a good idea because I'll have to write/read a file for each user and this scenario includes around 500 users...

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.