Tuesday, September 4, 2012

GetROProperty Method in QTP

   
                    GetROProperty method is used to identify an object in an Run time, It retrieves the properties and values where the QTP is recorded also the property is listed in the script. 

Here we can see the few examples that how the Getroproperty is work for an real time applications.
Below scripts will get the entire object properties in a msgbox for the declared unique properties in the scripts. So that we can ensure those object Properties are present in the application.

'www.google.com

Set wsh=Createobject("wscript.shell")
Set olink=Description.Create
olink("micclass").value="Link"
Set olinkcoll=Browser("name:=Google").Page("title:=Google").ChildObjects(olink)
'The script will pass the total number of links present in the message box
msgbox olinkcoll.count
For i=0 to olinkcoll.count -1
lslink=olinkcoll(i).getroproperty("name")
lsurl=olinkcoll(i).getroproperty("text")
wsh.Popup lslink,1,"The link name is"
wsh.Popup lsurl,1,"The url of the link is"
Next

'www.yahoo.com

Set wsh=Createobject("Wscript.Shell")
Set olink=Description.Create
olink("micclass").value="Link"
Set olinkcoll=Browser("name:=Yahoo! India").Page("title:=Yahoo! India").ChildObjects(olink)
'The script will pass the total number of links present in the message box
msgbox olinkcoll.count
For i=0 to olinkcoll.count-1
lslink=olinkcoll(i).GetROProperty("name")
lsurl=olinkcoll(i).GetRoproperty("Link")
wsh.Popup lslink,1,"The Link name is"
wsh.Popup lsurl,1,"The url of the link is"

'www.rediff.com

Set wsh=CreateObject("Wscript.Shell")
Set olink=Description.Create
olink("micclass").value="name"
Set olinkcoll=Browser("name:=Rediff.com - India, Business, Stock, Sports, Cricket, Entertainment, Bollywood, Music, Video and Breaking news, Rediffmail NG, Shopping").Page("title:=Rediff.com - India, Business, Stock, Sports, Cricket, Entertainment, Bollywood, Music, Video and Breaking news, Rediffmail NG, Shopping").ChildObjects(olink)
'The script will pass the total number of links present in the message box
msgbox olinkcoll.Count
For i=0 to olinkcoll.count-1
lslink=olinkcoll(i).GetROProperty("name")
lsurl=olinkcoll(i).GetROProperty("Link")
wsh.Popup lslink,1,"The link name is"
wsh.Popup lsurl,1,"The url of the link is"
Next

'Default flight Application


Dlgname=Dialog("nativeclass:=#32770").GetROProperty("text")
msgbox Dlgname
lsbtnstatus=Dialog("text:="&Dlgname).winbutton("text:=OK").getroproperty("enabled")
If lsbtnstatus Then
msgbox "PASS"
End if



31 comments:

  1. reates and returns a reference to an Automation object in QTP

    SYNTAX: CreateObject(servername.typename [, location])

    Arguments
    servername: Required. The name of the application providing the object.
    typename : Required. The type or class of the object to create.
    location : Optional. The name of the network server where the object is to be created.

    ReplyDelete
  2. Excellent Post.Also Visit http://www.whiteboxqa.com/WBQA/SEO/qtp-videos.php

    ReplyDelete
  3. Hi
    Please solve my doubt.

    I have clicked the radio button as FTP in window,

    then following script has been written.
    JavaDialog("Wired Node 2 - Properties").JavaRadioButton("FTP").Set
    But i want to know whether the FTP radio button has been set or not.

    How can i check that?

    ReplyDelete
  4. Thanks for giving important information to training seekers,Keep posting useful information

    QTP Training Chennai

    ReplyDelete
  5. That was a very informative post. Thank you so much. Keep posting more.
    Raksha
    QTP Training in Chennai | QTP Training in Chennai

    ReplyDelete
  6. Nice post...I look forward to reading more, and getting a more active part in the talks here, whilst picking up some knowledge as well..

    Pass Box manufacturers

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. Good Post. Its very helpful to the people who learn QTP.
    Find VBScript Material for QTP Preparation.

    ReplyDelete
  10. I just want to say I’m new to weblog and certainly savored this page. Almost certainly I’m likely to bookmark your website . You actually have outstanding well written articles. Cheers for sharing with us your website.

    Seo Training in Chennai

    ReplyDelete
  11. wow really superb you had posted one nice information through this. Definitely it will be useful for many people. So please keep update like this.

    Digital Marketing Company in Chennai

    ReplyDelete
  12. Being new to the blogging world I feel like there is still so much to learn. Your tips helped to clarify a few things for me as well as giving..
    Back to original

    ReplyDelete
  13. This comment has been removed by the author.

    ReplyDelete
  14. Thanks for making this guide and you have given such a clear breakdown of technology updates. I've seen so many articles, but definitely, this has been the best I?ve read!
    Selenium Training in Chennai
    Loadrunner Training in Chennai
    PHP Training in Chennai
    cloud computing training in chennai
    Salesforce Training in Chennai
    DOT NET Training in Chennai

    ReplyDelete
  15. Whatever we gathered information from the blogs, we should implement that in practically then only we can understand that exact thing clearly, but it’s no need to do it, because you have explained the concepts very well. It was crystal clear, keep sharing..
    Salesforce Training in Chennai
    Salesforce crm Training in Chennai
    Salesforce administrator training in chennai
    Salesforce certification Training in Chennai
    Salesforce.com training in chennai

    ReplyDelete
  16. I think things like this are really interesting. I absolutely love to find unique places like this. It really looks super creepy though!! php training in chennai
    php training in velacher chennai

    ReplyDelete
  17. Thank you for updating such an informative content. We Offer the Best QTP Training in Chennai with 100% Placement. More Course are Machine Learning Training, Hardware and Networking Training, Advanced Excel Training, etc.,.

    ReplyDelete
  18. I really love the theme/design of your website. Do you ever run into any browser compatibility problems? A small number of my blog audience have complained about my site not working correctly in Explorer but looks great in Safari. Do you have any ideas to help fix this problem?

    Authorized macbook pro service center in Chennai | Macbook pro service center in chennai | Authorized iMac service center in Chennai | iMac service center in chennai | Mac service center in chennai | iphone unlocking service

    ReplyDelete
  19. Hey, would you mind if I share your blog with my twitter group? There’s a lot of folks that I think would enjoy your content. Please let me know. Thank you.
    qtp training in chennai | Best QTP Training Institute in Chennai | QTP Training Institute in Chennai | best qtp training in chennai

    ReplyDelete
  20. Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's. good works guys.
    Ai & Artificial Intelligence Course in Chennai
    PHP Training in Chennai
    Ethical Hacking Course in Chennai Blue Prism Training in Chennai
    UiPath Training in Chennai

    ReplyDelete
  21. Is There A Link That You Could Share That Would Give Us A More Detailed Rundown On How Fxtm Review Works ?

    ReplyDelete