What is the function used while writing reusable actions scripts? and on what basis you will select reusable actions?

Showing Answers 1 - 8 of 8 Answers

madhu

  • May 19th, 2006
 

Subash,

Please read the question, which u sent across.

Generally reusable scripts/actions will using based on the requriment.

Eg: Login script (for any application this is must)

Inside the application there are different modules, say saving and checking account.

For a bank customer will be login to the application to make a transaction. For any customer login is must. But the account number is different ie login id is different and he will doing different transactions.

In that case login script will be the reusable script. main script will saving Acc or checking account.

Regards,

Madhu D

  Was this answer useful?  Yes

Sai

  • Jul 17th, 2006
 

Hi All,

Can any one send me a function for Login screen in QTP?

Your help is highly appreciated,

Thanks and regards,

Sai K. Sankar

  Was this answer useful?  Yes

CREATING USER-DEFINED FUNCTIONS:(KEYWORD DRIVEN FRAMEWORK)
1. first record the login operation for once and place those statments in between 'Public function login(a,p)' and 'End function statements' (a=agent name,p=password). Replace 'agent name' input with "a" variable and 'password' input with crypt.encrypt("p") in recorded set statements.
2.Record and place Statements in public and end function statements for each function one by one.
3.Then copy all the statements 'ctrl+A' and 'ctrl+c' and paste & save them in notepad with '.vbs' extention.
4.In qtp, Resources menu-object Repository-File menu-Export local objects-save them with .tsr extention.
5.Delete those created statements from qtp test window.
(NOW FUNCTIONS ARE CREATED AND READY FOR USE.)

USING FUCTIONS:
To use those above created functions in a test, (for every test, the following procedure is to be followed to use user-defined functions)
1.File menu-settings-Resources tab-Add(+) icon-Browse the path of the file created above with .vbs extention.
2.Resources menu-Associate Repository-Add(+) icon-Browse the path of the file created above with .tsr extention.
3. example for invoking login function.    login "agent name","password"

  Was this answer useful?  Yes

When you create an action, click on the Reusable Actions check box.
When your application changes, you can rerecord a
specific action, without changing the rest of the test. Whenever possible,
insert calls to reusable actions rather than creating identical pieces of script
in several tests.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions