Consider the Scenario, parameterizing the Username and Password in Login screen,
1.Record the script
2.Create a dataset for username and password in different notepads and save it with extension .fvr
3.Copy the created files and place it in the Data Folder of OpenSTA installation directory,
3.Copy the created files and place it in the Data Folder of OpenSTA installation directory,
Ex:C:\Program Files\OpenSTA\Repository\Data
4.Under the Definition section of the recorded script place the following lines,
CHARACTER*512 fileuser, FILE = "users", SCRIPT
CHARACTER*512 filepassword, FILE = "password", SCRIPT
CHARACTER*100 currentUsername, LOCAL
CHARACTER*100 currentPassword, LOCAL
Note:
users - filename of the file that contains the username
password - filename of the file that contains the password
5.In the script recorded, above the Post url where the login data will be passed, place the following code,
ACQUIRE MUTEX "Logn"
NEXT fileuser
NEXT filepassword
SET currentusername = fileuser
SET currentpassword = filepassword
LOG "User: ", fileuser, " - Password: ", filepassword
LOG "User: ", currentUsername, " - Password: ", currentPassword
RELEASE MUTEX "Logn"
Note:
Make sure you use the mutex, or each thread may not use a distinct value from the list/file.
6.In the Post Url section replace the values passed in login with the variables we have created i.e currentusername for Username and currentpassword for Password.
7.Run the Script, different values will be passed for different iterations from the file created.
2 comments:
Hi sagar, thanks for leaving ur comment in my blog, i will have ana eye on your blog too..
Great post with nice details withI have the add link but I end up creating two pages ............I read it very seriously .
Visit Also Here:--
Open ad posting
Free ad posting
Post a Comment