SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Apr 2008
    Location
    India
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    What is difference between objects?

    Set myBrowser=Description.Create
    myBrowser("micclass").Value="Browser"
    set allBrowsers=Desktop.ChildObjects(myBrowser)
    set br=allBrowsers(0)
    Title=br.GetROProperty("title")

    Above code works but not below one
    Set myBrowser=Description.Create
    myBrowser("micclass").Value="Browser"
    set allBrowsers=Desktop.ChildObjects(myBrowser)
    set br=allBrowsers(0)
    Title=Browser(br).GetROProperty("title")

    Please notice the last sentence
    As the allBrowsers(0) returning browser object why cant i use that as Browser(br)?

    Thanks,
    Uma

  2. #2
    SQA Knight
    Join Date
    Jul 1999
    Location
    Grand Rapids, MI
    Posts
    3,727
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: What is difference between objects?

    [ QUOTE ]

    set br=allBrowsers(0)
    Title=Browser(br).GetROProperty("title")
    .
    Please notice the last sentence
    As the allBrowsers(0) returning browser object why cant i use that as Browser(br)?


    [/ QUOTE ]
    Because br is an object and not a string. So you can use br in this form:

    Title=br.GetROProperty("title")

  3. #3
    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: What is difference between objects?

    Browser(br) would only work if Br is a description object and not a browser object.

    Why would some use a effective statement of below kind

    Browser(Browser("X"))....

    I hope you understand now the difference

  4. #4
    Apprentice
    Join Date
    Mar 2008
    Posts
    28
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: What is difference between objects?

    Thanks Tharun for your reply. But i have another question what is meaning of set br=allBrowsers(0)This line

  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: What is difference between objects?

    set allBrowsers=Desktop.ChildObjects(myBrowser)

    Above statement returns a collection of browser object

    set br = allBrowsers(0)

    Above statement gives the 1st browser from the collection. It is actually

    set br = allBrowsers.item(0)

    Because item is the default method

  6. #6
    Junior Member
    Join Date
    Apr 2008
    Location
    India
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: What is difference between objects?

    [ QUOTE ]


    Browser(Browser("X"))....



    [/ QUOTE ]

    This Really clarifies what's the exact difference Thanks!

 

 

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 11.54%
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 08:05 PM.

Copyright BetaSoft Inc.