Pages

Sunday, April 3

Descriptive Programming in QTP - Part 4



Hello Friends!


In Part-1, Part-2, Part-3 of this post we learned basics, type, use and various methods of descriptive programming.


In this part we will continue with more good stuff.. :)


Apart from GetROPropety, these are some other methods which are very useful in DP.


- GetTOProperty
- GetTOProperties

- SetTOProperty



GetTOProperty returns the value of the specified property from the test object description.


Example:
Msgbox Browser("MyBrowser").Page("MyPage").GetTOProperty("html tag")




GetTOProperties returns the collection of properties and values used to identify the object.


Example:
Set Propset = Browser("MyBrowser").Page("MyPage").GetTOProperties
Above statement will give you all the properties used in object identification by QTP to an array Propset. All these properties and values can be retrieved using below code..


For i = 0 to Propset.Count-1
    Print Propset(i).Name & ":=" & Propset(i).Value
Next

SetTOProperty is used to set the value of the specified property in the test object description. It is used when you require to change the any particular property at run time.


For Example you need to work open/work on two instances of an application at same time. Obviously, all the properties will be same. In this situation you can use SetTOProperty to change properties at run-time.


Please note that changes made by SetTOProperty will be applicable at runtime only. Once your execution is finished, no change will be saved. Also changes will be applicable to that action only.



Example:
Browser("MyBrowser").Page("MyPage").WebElement("my text").SetTOProperty "Style", "'color:blue'"


Feel free to post comments if you have any question from this or last three posts.

55 comments:

  1. hi can u explain the get, set properties with more syntax

    ReplyDelete
  2. All the posts are Very Good and really helpful.
    Thanks for sharing such a good knowledge on site.

    Thanks.

    ReplyDelete
  3. Classic and simple examples Mr.Jain. Thanks for sharing such great knowledge.

    Thanks
    Anvitha

    ReplyDelete
  4. hi
    i couldn't get the difference between gettoproperty and getroproperty

    please elaborate a little more.

    ReplyDelete
  5. Thnx... very simple and helpfull

    ReplyDelete
  6. Hi Abhikansh,
    First of all thanks for this informations which are really help full.
    I have question that how a tester use these properties (GetTOProperty,GetTOProperties,SetTOProperty) in real testing environment.
    I want to understand the concept of using these properties.

    I hope you will explain this very well.
    Thanks
    Nikunj

    ReplyDelete
  7. Awesome ...U r doing a great job..Its really helpful

    ReplyDelete
  8. This blog is very helpful please add more codes with examples for verious topis.

    ReplyDelete
  9. blog is useful? if testing a website how to write script using Descriptive Programming ? can u give me an sample?

    ReplyDelete
  10. Hello Mr Abhikansh,

    Thanks for very useful posts.
    It could be great if you can post some sample projects which completes the whole sense of all your posts.

    ReplyDelete
  11. @Sushma - Thanks for your words. Its not feasible to post whole projects on blog as a project/framework has lots of components!!

    More then happy to help on any queries you have..

    ReplyDelete
  12. @ Nikunj

    GetTOProperty - most commonly used, gives a one particular property
    GetTOProperties - gives all the properties of object in an array
    SetTOProperty - used to set a property at runtime

    I'll try to write a post on it asap. Thanks.

    ReplyDelete
  13. Your information about qtp is really interesting. Also I want to know the latest new techniques which are implemented in qtp. Can you update it in your website?
    Qtp training Chennai

    ReplyDelete
  14. Hi..Interesting posts.. I need to assign a variable to getroproperty..for example I want to write like this..B= Browser("Yahoo Finance - Business").Page("Yahoo Finance - Business_2"). Frame("mainFrame_5").WebElement("O").GetROProperty("innertext") ` Current Price....is it possible to write like this?

    ReplyDelete
  15. Technology place a vital part in humans ecosystem. So in order to survive one must be up to date. Thanks for sharing this information in here. Keep blogging article like this. I have bookmarked this page for future reference.

    Hadoop Training Chennai

    ReplyDelete
  16. Nice..You have clearly explained about the conept..Its very useful for me to undertand..Keep on sharing..
    Hadoop training in chennai

    ReplyDelete
  17. Excellant content. To know the details and importance of python course visit below. Python is an object oriented high level programming language which is built in data structures combined with dynamic typing and dynamic binding making it very attractive for rapid application development.
    Python Training in Chennai | Python Course in Chennai

    ReplyDelete
  18. Thanks for Sharing the valuable information and thanks for sharing the wonderful article..We are glad to see such a wonderful article..
    QTP Training in Chennai | QTP Training Institute in Chennai | QTP Training

    ReplyDelete
  19. Excellent sharing. Testing is a wonderful field for IT peoples. Want to learn Selenium Training reach GangBoard. Hadoop Online Training

    ReplyDelete
  20. I would like to say thank you for the amazing details and concepts you are sharing in this.
    Webseiten Gestaltung Lüdenscheid

    ReplyDelete
  21. I found a lot of interesting information here. A really good post
    office 2010 professional plus key deutsch

    ReplyDelete

  22. Thanks For Your valuable posting, it was very informative
    Internet Marketing Dienstleistungen

    ReplyDelete
  23. There are so many useful information in your post, I like it all the time. And I want to share this boost app ranking with you, you can take a look. This is very useful.

    ReplyDelete
  24. Very interesting content which helps me to get the in depth knowledge about the technology. Thanks for sharing and keep updating.
    MSC Project Center in Chennai | MSC Project Center in Velachery

    ReplyDelete
  25. I think it's awesome. I hope all goes well with this articles. More new information gained.
    ME/M.Tech Project Center in Chennai | ME/M.Tech Project Center in Velachery

    ReplyDelete
  26. Very happy to see this blog. Gives a wonderful information with coded explanaion. Thank you for this blog. very useful to me.
    Java Training in Chennai | Web Designing Training Institute in Chennai | DotNet Training Institute in Chennai

    ReplyDelete
  27. Amazing writeup. Very much useful for beginners. Thanks for sharing...
    IEEE Project Center in Chennai | IEEE Project Center in Velachery

    ReplyDelete
  28. Awesome blog with informative content.Thanks for sharing such a nice blog..Java Project Center in Chennai | Java Project Center in Velachery

    ReplyDelete
  29. Amazing Article, thank you!. I am very glad to read your informative & practical blog. Kindly keep updating your blog.

    white label website builder

    ReplyDelete
  30. Pretty article! I found some useful information in your blog, it was awesome to read.DotNet Project Center in Chennai | DotNet Project Center in Velachery

    ReplyDelete
  31. I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
    aws training in Chennai

    ReplyDelete
  32. Your website content nice nice and interesting to observe.
    jobbörse Neunkirchen

    ReplyDelete
  33. I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
    aws training in Chennai

    ReplyDelete
  34. I really enjoy simply reading all of your weblogs. Simply wanted to inform you that you have people like me who appreciate your work.
    Python Certification Exam Center in Chennai | Best Python Courses in Tambaram

    ReplyDelete
  35. Nice Post! It is really interesting to read from the beginning & I would like to share your blog to my circles, keep your blog as updated.


    aws training in chennai

    selenium training in chennai

    python training in chennai

    ReplyDelete
  36. Those guidelines additionally worked to become a good way to
    recognize that other people online have the identical fervor like mine
    to grasp great deal more around this condition.

    hadoop training in chennai

    angularjs training in chennai

    devops training in chennai

    digital marketing training in chennai

    ReplyDelete