Micro Focus QTP (UFT) Forums
Parameterizing a part of script - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Parameterizing a part of script (/Thread-Parameterizing-a-part-of-script)



Parameterizing a part of script - itsnotmyid - 08-04-2011

hi guys

i am facing an issue

i have different actions for login to application and logging out from application

i.e

"login" (action name) to login to application
"logout" (action name) to log out from application

now in a new test (say "usercreation"----->name of test )i have the script to create user
name of action in this test is "createuser" (action name)
the test usercreation is parameterized for a set of data which is working fine when i run the test i.e only create user it creates the required no of user

but i want to login create user (n no. of times) then logout
now when i call the actions "login" and "logout" and arrange the actions as login->createuser->logout
the application is "logging in creating user then it logs out" then again it logins create user for another set of data the logsout"
while the requires scenario is it should "login create user (n no fo times without logging out) then once all users are created then logout"


RE: Parameterizing a part of script - sshukla12 - 08-05-2011

U want to run your second action i.e. to create the user(Create user) n number of times. for this u have to specify the no. of iterations your action should go
RunAction Actionname,Iteration,Parameters
Ex: Runaction "CreateUser",n

Correct me if wrong

Regards,
Sankalp


RE: Parameterizing a part of script - Tarik Sheth - 08-05-2011

The way to do is.

Code:
Call Login
For i=1 to DataTable.GetRowCount("Login_User","Global") ' This has all number of user Di that you are trying to create
   Call createUser(ByVal Login_User)
Next
Call LogOut




RE: Parameterizing a part of script - parminderdhiman84 - 08-09-2011

Hi,

Please use the code below:

Code:
RunAction Login

rw_cnt=DataTable.GetCurrentSheet("Global").GetRowCount

For i=1 to rw_cnt
   DataTable.SetCurrentRow(i)
   RunAction CreateUser
Next

RunAction Logout

Regards,
Parminder