Functions in QTP, How To Use of Functions in Quick Test Professional



Functions in QTP, How To Use of Functions in Quick Test Professional

  1. Functions is like bunch of code which can be used multiple times in our whole code. Then we should create function which is called user defined function. With the help of user defined functions, our test become maintainable, easier to design, readable easily, and shorter.
  2. Function Libraries related to you, can contain modules, VB Script Functions, subroutines etc.
  3. To use function from any library for your test scenario, we need to follow the following three very simple steps.
  4. Let's us create the library in QTP for new function.
  5. First Select File → New → Function Library. This will open in new Tab in QTP.
  6. For example we will create a very easy and simple function to show the message box, So whenever this function will be called then a message box must be displayed.
  7. You can keep several functions defined in the same located files. Let us save the file.
  8. The extension of function is .qfl.
  9. Further Next step is Associate your created library with the created test by you.
  10. Now click on File > Setting> Resources> Associate Function Library. Click to Add Now. Now Select the Function from Library File. Finally Click on OK.
  11. Now Last Step is just using the Created Function
  12. Simply call the required function in your call. As when your test will run then expected Message Box should be displayed.
  13. Using DCOM, COM objects or instances we can create very intelligent and Advanced Methods or functions.
  14. Benefits is that Multiple QTP features can be develop or coded in VBScript.
  15. Generally automation engineers make it more of a VB project instead of automation project.
  16. But we suggest to focus on 100% automation instead of flaunting your VB skills. 




















    Android Install Apps to SD Card Default
    Developer vs Tester a fake competition


    QTP TESTING STEPS How to Record a QTP Script






No comments:

Post a Comment

Popular Posts