SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2
  1. #1
    Advanced Member
    Join Date
    Aug 2006
    Location
    Other side of the Computer
    Posts
    598
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Find page of an object

    if you have an object, how do you find the page it is in?
    following is an example that I am sending the object to a function and it is failing because it can not find the object but if I put this in the code and perform a .Refresh of the page, I get the item back. so my question is how do you find the parent/page of an object? so when pass it to function I can find the page object and perform a refresh.

    Set pg = Sys.Process("iexplore").IEFrame(1).Page("*master/default.aspx*").Find("ObjectIdentifier","chartCode _Image",5000)
    ===========================================

  2. #2
    Senior Member
    Join Date
    Nov 2008
    Posts
    119
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Find page of an object

    Does the parent page change? I noticed you had the wildcard in there.

    If so could you not use find, to find that parent object,

    Then use find child to find the object on screen?

    For example:

    Set pg=Sys.Process("iexplore").IEFrame(1).Find(xx, yy, z, Refresh)

    Where XX =propname, yy=property value, z=depth, Refresh=True)

    This means test complete would look for the parent, if not found refresh to find it in the hierary by the property name/value.

    Then once you found this the next line of code would be finding the child object.

    OR....the parent appears to also have a parent (iexplore.IEFrame)...you could use findchild twice if you wanted and if these things were varible.

    Hope that wasn't too confusing:

    Here's an example of findchild using notepad: Instead of logging a message you could call click, keys, etc. (VBScript)

    Sub Test
    Dim PropArray, ValuesArray, p, w

    ' Creates arrays of property names and values
    PropArray = Array("WndCaption", "Visible")
    ValuesArray = Array("Font st&yle:", True)

    ' Searches for the window
    Set p = Sys.Process("Notepad")
    Set w = p.FindChild(PropArray, ValuesArray, 5)

    ' Processes the search results
    If w.Exists Then
    Log.Message w.FullName
    Else
    Log.Error "The object was not found."
    End If
    End Sub

 

 

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 10:38 AM.

Copyright BetaSoft Inc.