SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    Jun 2004
    Location
    India
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Want to access "class" property of the object.

    Hi I am at intermediate level of QTP,
    Here is my problem-

    I am trying to get object type or class of the any object.
    for Ex. if object is Weblist,Button,Browser,Page,etc I want class property of the object.

    I tried following ways-
    1.Configure "Class"property from Object Identification option.
    Here OR is not showing "value" for Class property.

    2.Browser("xxxl").Page("yyyl").Frame("aaaaaa").Web Element("button").Object.className
    Here class property is showing blank

    3.by using Object.ClassName property.
    Here class property is showing blank

    *I am facing problem is Value is not visible in to class property in OR.

    Suggest Me the right approch.

    Thanks,
    QASpider

  2. #2
    Senior Member
    Join Date
    Oct 2005
    Location
    Universe
    Posts
    393
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Want to access "class" property of the object.

    Hi,

    Try using Object.type although it will not return the actual Class name but the result that you get will be useful for you.

    Thanks,
    Wasim

  3. #3
    Senior Member
    Join Date
    Feb 2005
    Location
    Northern Ireland
    Posts
    529
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Want to access "class" property of the object.

    IIRC (I don't use QTP anymore) there was a property, nativeclass, that all objects should have. Couldn't say if it would be accesable from GetROProperty or not, but it may be worth a shot?
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">masgbox Browser(&quot;xxxl&quot.Page(&quot;yyyl&quot.Frame(&quot;aaaaaa&quot.WebElement(&quot;button&quot.GetROProperty(&quot;nativeclass&quot</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">HTH.
    I'm not a complete idiot - some parts are missing.

  4. #4
    Junior Member
    Join Date
    Jun 2004
    Location
    India
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Want to access "class" property of the object.

    Thanks for all efforts,

    *But still not working with all above solutions
    1.Tag,2.nativeclass,3.Object.type

    Any more bullet ?
    QaSpider

  5. #5
    Senior Member
    Join Date
    Sep 2000
    Location
    Twin Cities, MN, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Want to access "class" property of the object.

    ClassName isn't a required property for HTML elements. I don't know about nativeclass but it's worth a shot. object.tagName will get you there. Every HTML element has a tag, naturally.

  6. #6
    Senior Member
    Join Date
    Oct 2005
    Location
    Universe
    Posts
    393
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Want to access "class" property of the object.

    Hi,

    Object.type will not work for WebElement and Link but will work fine for the rest of the web objects.

    Thanks,
    Wasim

  7. #7
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Want to access "class" property of the object.

    Try using

    .object.Class
    .object.ClassName
    .object.TypeName

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.00%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 04:11 PM.

Copyright BetaSoft Inc.