SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Senior Member
    Join Date
    May 2006
    Location
    Israel
    Posts
    338
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Can descriptive-programming objects be re-casted?

    Hey all.

    A quick question:
    Let's say I use DP to set a QTP reference :
    Set oButton = SwfWindow("index:=0").SwfObject("index:=0")

    Can I later re-cast that object to SwfButton class?
    I've tried changing the TO micclass property to "swfButton", but I still can't make QTP treat the object as a recognized button, and not a general object.

    Thanks in advanced!
    www.AdvancedQTP.com
    'coz we're programmers - not users

  2. #2
    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: Can descriptive-programming objects be re-casted?

    Thats not the correct way...

    use

    Set oButton = SwfWindow("index:=0").SwfButton("index:=0")

  3. #3
    Senior Member
    Join Date
    Jan 2007
    Location
    Pune, India
    Posts
    466
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can descriptive-programming objects be re-cast

    I think when you are doing descriptive programming you have to follow object hierarchy according to development or you can skip some object level. But there is nothing with Re-Casting of objects.

  4. #4
    Senior Member
    Join Date
    May 2006
    Location
    Israel
    Posts
    338
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can descriptive-programming objects be re-cast

    Jits, thanks. I was afraid of that.

    Tarun, No doubt that's the preferable way of doing things. The problem is I'm trying to use a generic Object-Reference function, which might not know it's a button, so it will create a ref to a general SWFObject.

    The question is, can that casting be changed later?

    I could add another Select-Case structure in the Object-Reference function, but that will force me to change the data flow through the script structure, and I would rather not do that.
    www.AdvancedQTP.com
    'coz we're programmers - not users

  5. #5
    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: Can descriptive-programming objects be re-cast

    [ QUOTE ]
    Tarun, No doubt that's the preferable way of doing things. The problem is I'm trying to use a generic Object-Reference function, which might not know it's a button, so it will create a ref to a general SWFObject.

    [/ QUOTE ]

    Thats not the correct way to do it
    Look at http://www.sqaforums.com/showflat.ph...;Number=372868

  6. #6
    Senior Member
    Join Date
    May 2006
    Location
    Israel
    Posts
    338
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Can descriptive-programming objects be re-cast

    Thanks
    www.AdvancedQTP.com
    'coz we're programmers - not users

 

 

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 7.69%
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 10:26 AM.

Copyright BetaSoft Inc.