Results 1 to 3 of 3
  1. #1

    functions and procedures

    hi all,

    can any body explain ,how can i write user defined functions and procedures and where i need to set the function files. and how can i call in my scripts.

    if any body have material or any scripts which are used in real time applications, please please provide them..

    thanks in advance

  2. #2

    Re: functions and procedures

    in VBS there are 2 things (Function and Sub)
    here is how to use a function, and using a Sub is similar.

    1- Open the Notepad and paste the below
    Function myValue
    myValue= 3
    End Function
    2- save the file as .VBS (note: change the save as file to All files inorder to save as .vbs)
    3- open QTP and go to Test Settings menu
    in QTP8.2 you will find it under Test , in QTP9.0 under File.
    4- in the Test Settings pan click on the Resources tab and add the VBS file you created in step 2
    5- now you can use your function in QTP
    msgbox myValue 'will print out 3

    hope this help.
    "I realize it's an error, but no one is going to try to do that!"
    From "Top 10 Stupid Comments from Developers".

  3. #3

    Re: functions and procedures

    Search the forums, you will find many examples.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 07:19 PM.

Copyright BetaSoft Inc.