Results 1 to 20 of 20

Thread: QTP scripts

  1. #1
    Junior Member
    Join Date
    Nov 2007
    Answers
    3

    QTP scripts

    Can we prepare QTP scripts for GUI applications without actually adding the objects to Object Repository? or by adding objects at run time?


  2. #2
    Expert Member
    Join Date
    Oct 2007
    Answers
    375

    Re: QTP scripts

    Hi Shwe30,

    Yes we can prepare scripts without actually using objects present in the Object Repository.
    We call this method as Descriptive Programming. We can list the set of Properties and values that describe the object as part of our coding syntax itself.

    Example
    Set myObj = Description.Create()
    myObj("AttachedText").value:="agentName"
    myObj("html Tag").value:="a".

    Iin the first sentence we are trying to define the attached Text with the specific object and in the second since it is an HTML Object, we are defining its html Tag value. Based on these statements, QTP can identify the object and work with it.

    For adding Objects at Runtime, we could create an Application Variable using which we open the QTP repository at runtime and we could add the object at runtime. But I would not advise that. Using Descriptive programming to handle Dynamic objects would be better.

    Runtime properties can be retrieved using the GetRO Property method.

    Cheers......


  3. #3
    Junior Member
    Join Date
    Nov 2007
    Answers
    3

    Re: QTP scripts

    hmm....Thats a great solution...Thanks!!!!


  4. #4
    Contributing Member
    Join Date
    Nov 2007
    Answers
    88

    Re: QTP scripts

    Thats grate ,good answer


  5. #5
    Contributing Member
    Join Date
    Nov 2007
    Answers
    48

    Re: QTP scripts

    Hi,

    Yes we can create QTP scripts for GUI applications without having object information in Objcet Repositry. For this you have to go for DESCRIPTION PROGRAMMING.

    Regards,
    SYCHO

    Quote Originally Posted by Shwe30 View Post
    Can we prepare QTP scripts for GUI applications without actually adding the objects to Object Repository? or by adding objects at run time?



  6. #6
    Junior Member
    Join Date
    Aug 2007
    Answers
    1

    Re: QTP scripts

    yes we can prepare script without using objects present in the object repository


  7. #7
    Junior Member
    Join Date
    Apr 2007
    Answers
    23

    Re: QTP scripts

    If you want to prepare QTP scripts for GUI applications & any application without actually adding the objects to Object Repository there is only one way likw DESCRIPTIVE Programming


  8. #8
    Junior Member
    Join Date
    Aug 2007
    Answers
    2

    Re: QTP scripts

    bizzare,
    thanks for the info,
    could you please explain more on
    how to use Descriptive programming to handle Dynamic objects.

    Quote Originally Posted by bizzzzzare View Post
    Hi Shwe30,

    Yes we can prepare scripts without actually using objects present in the Object Repository.
    We call this method as Descriptive Programming. We can list the set of Properties and values that describe the object as part of our coding syntax itself.

    Example
    Set myObj = Description.Create()
    myObj("AttachedText").value:="agentName"
    myObj("html Tag").value:="a".

    Iin the first sentence we are trying to define the attached Text with the specific object and in the second since it is an HTML Object, we are defining its html Tag value. Based on these statements, QTP can identify the object and work with it.

    For adding Objects at Runtime, we could create an Application Variable using which we open the QTP repository at runtime and we could add the object at runtime. But I would not advise that. Using Descriptive programming to handle Dynamic objects would be better.

    Runtime properties can be retrieved using the GetRO Property method.

    Cheers......



  9. #9
    Junior Member
    Join Date
    Nov 2007
    Answers
    2

    Re: QTP scripts

    Really fine ans.....


  10. #10
    Junior Member
    Join Date
    Jun 2007
    Answers
    4

    Re: QTP scripts

    good to know


  11. #11

    Re: QTP scripts

    Quote Originally Posted by Shwe30 View Post
    Can we prepare QTP scripts for GUI applications without actually adding the objects to Object Repository? or by adding objects at run time?
    No,We cant prepare scripts for gui applns without adding objects to Object Repository because Object Repository acts as LIBRARY for the applns.Hence for scripts to run there should be objects in the repository


  12. #12
    Expert Member
    Join Date
    Oct 2007
    Answers
    375

    Smile Re: QTP scripts

    Hi Panish,

    I am sorry but it seems you did not go through the question completely. Preparation of GUI scripts without objects in the repository is being discussed with respect to QTP tool alone.

    QTP does provide you a concept called as Descriptive programming which enables you to work without actually having the object present in the Repository.

    Please do read through the chain of mails incase you wish to know more about this.

    Yes you are true in one sense..... Tools like Winrunner and Rational Robot do not allow you to create scripts without the object being present in the Repository. But they do enable Opening the GUI Map at runtime and adding objects dynamically.

    Hope this clears things a bit.....

    Cheers......


  13. #13

    Smile Re: QTP scripts

    Thanks Ya i was bit confused with mercury tools You are right there is a method called DESCRIPTIVE PROGRAMMING


  14. #14

    Re: QTP scripts

    Hi,
    does it mean that we are indirectly adding object data into repository.So every time u run the appln its creating a collapsing repository.., i mean repository for just 1 run.Is it true????


  15. #15
    Expert Member
    Join Date
    Oct 2007
    Answers
    375

    Smile Re: QTP scripts

    Hi panish,

    No how Descriptive programming works is that instead of adding objects to repository, you code the object along with its mandatory properties as part of scripting syntax.

    Thus these objects are not created as part of any collapsing repository. Hence they are still valid for any number of runs.

    Yes had it been the concept of Collapsible repository, definitely it would not have exsited for more than 1 run.

    But since we use the methods of creating objects and associating their description along with it, it works fine for all runs.

    Set myObj = Description.Create()
    myObj("AttachedText").value:="agentName"
    myObj("html Tag").value:="a".

    The sentence Description.create actually creates a Description Object to which you can associate your Object Properties.

    Cheers....


  16. #16

    Re: QTP scripts

    hi

    In QTP scripts by discription programming to avoid the adding objects to the object repository before and runtime.


  17. #17
    Junior Member
    Join Date
    Jun 2007
    Answers
    2

    Re: QTP scripts

    Thanks.Good to know the correct answer.


  18. #18
    Junior Member
    Join Date
    Dec 2007
    Answers
    1

    Re: QTP scripts

    Can any one suggest me where to get the
    QTP guide for getting better understanding on the usage of QTP Scripts and functionalities.
    Currently i went through the Tutorial for understanding. But i need more info on the QTP Scripts. Please guide me


  19. #19
    Junior Member
    Join Date
    Dec 2007
    Answers
    21

    Re: QTP scripts

    we can go to the discreptive programing only when object repository could not find out the object propertirs.

    we can add the properties at the Run time by using "SetTo Property("Property name ,Value")

    Do you have any clarifictions ,let me know

    Thanks&Regards,

    Ravikumar


  20. #20
    Expert Member
    Join Date
    Sep 2007
    Answers
    110

    Re: QTP scripts

    What you said is correct Mr. Ravikumar,
    But how you can add the properties at runtime by using SetToProperty method.
    I think it is not possible by using SetTOProperty method.
    Yes.... you can add the properties to the objects by using SetTOProperty method, but not at runtime.
    For adding properties at run time, we need SetROProperty method. But QTP doesn't have such kind of method.

    I think you got an idea....


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