Results 1 to 5 of 5

Thread: An example of QTP scripts

  1. #1
    Junior Member
    Join Date
    Feb 2008
    Answers
    1

    An example of QTP scripts

    I have basic understanding on QTP, vbscript and javascript. But i m not knowing where the scripting is used because record, run, data table parameter, wait property, syncro, if and loop statments can be directly added...where scripting is coming in picture? what is use of it? How it is used?


  2. #2
    Expert Member
    Join Date
    Jan 2007
    Answers
    211

    Re: An example of QTP scripts

    1. when ever you are doing validations in your test you need to fetch data from the Object's in varying fashion as per your requirement...for eg:if your requirement to test the IE Window for some application that has title bar appended by the Account ID that is unique for an Individual, for testing that you need to parse the text of the title there comes SCRIPTING.

    2. In specific case when-ever there are custom controls that are not identified uniquely by QTP we need to write Functions that do parsing of the Data and provide the requirement.

    3. In Case there are some keyboard enabled events in your test, you are required to perform shell programming to trigger those event(shell scripts).

    4. VBScript functions are used to filter the data that appears in the application for test purpose.

    5. Regular Expressions are used to setup some parameterize checkpoints that are in case not Feasible with the QTP inbuilt Checkpoints.

    6. In case you want to interact with the OTA of QTP or some integrated tools API's are processed and supported by VBScript..

    Lot's more to be added...Thank's for starting this thread..hope there will be more addition's to the above list.

    Regards,
    Nawab


  3. #3
    Banned
    Join Date
    Oct 2007
    Answers
    173

    Re: An example of QTP scripts


  4. #4
    Junior Member
    Join Date
    Jun 2009
    Answers
    1

    Script fot capturing screen shots

    Hi, am using a frame work which is written manually. can any one help me how to capture the screen shot when the error appears. i mean script


  5. #5
    Expert Member
    Join Date
    Apr 2008
    Answers
    1,859

    Re: An example of QTP scripts

    hai zakaulla,

    use this script
    Dim path_error_file ' Declare a variable which contains path of the error image
    path_error_file = "C:\Documents and Settings\Deepa\Desktop\error.bmp" ' Place the image on desktop
    Browser("Browser").CaptureBitmap path_error_file,True ' Use CaptureBitmap method to capture the screenshot, True will overwrite an existing error.bmp file
    Reporter.ReportEvent micFail,object_snap,"&"

    Thanks
    Deepa


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact