SPONSORS:






User Tag List

Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    Jan 2002
    Location
    Irvine, CA, USA
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Verifying dynamic text

    Need help or a push in the right direction.
    We have a utility that lists open connections therefore results change.

    I'd like to verify a specific text or total that appears somewhere at the bottom of the screen:
    "Total Open Connections: 0"

    However Windows Declarations does not recognize this one line as unique but instead lumps a bunch of counts and totals in one object.

    Part of the report looks like this (I did not include 50 or so lines that precede the first line below)

    “Report of Connection Statistics:
    .
    .
    .

    dxci.claim.bl.BatchSolutionDM
    No. Connections Opened: 1
    No. Connections Closed: 1
    No. Connections still open: 0

    dxci.claim.bl.ClaimItemDM
    No. Connections Opened: 1
    No. Connections Closed: 1
    No. Connections still open: 0

    dxci.claim.bl.ClaimStatusDM
    No. Connections Opened: 0
    No. Connections Closed: 0
    No. Connections still open: 0

    --------
    Total Open Connections: 0


    Report of Cache Statistics:

    Cache Statistics (2 caches)

    StateCache
    Keys in cache: 67
    Accesses: 11
    Values Found: 9 (82%)

    RoleCache
    Keys in cache: 2
    Accesses: 19
    References Found: 0 (0%)
    Values Found: 0 (0%) “ (end of report)

    Windows Declarations is as follows:

    [-] window BrowserChild WindowName [ ] tag "http:?? teststats.jsp"
    [ ] parent Browser
    [-] HtmlHeading ReportOfConnectionStatistic
    [ ] tag "Report of Connection Statistics:"
    [-] HtmlText DMStatisticsNoDMs36RELA
    [ ] tag "DM Statistics No. DMs: 36 RELATIONSHIP"
    [-] HtmlHeading ReportOfCacheStatistics
    [ ] tag "Report of Cache Statistics:"
    [-] HtmlText CacheStatistics2CachesSt
    [ ] tag "Cache Statistics (2 caches) StateCache Keys"


    The text I want to verify is lumped/located at :
    [-] HtmlText DMStatisticsNoDMs36RELA
    [ ] tag "DM Statistics No. DMs: 36 RELATIONSHIP"

    Options:
    Dynamic tags based on location
    A “get command” of some sort ?

    Your suggestions or sample code would be greatly appreciated.

    G
    Ps
    Did I mention that I am newbie.


    ------------------

  2. #2
    Senior Member
    Join Date
    May 2002
    Posts
    448
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Verifying dynamic text

    If I understand the problem correctly you want to verify for a specific text located in a lump or bunch. Try out the GetText () method to capture the entire text store it in a string and then verify for the specific value that you are looking for.

    ------------------
    never say die
    Life, that dares send, A challenge to his end,
    And when it comes say, Welcome friend.

  3. #3
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Verifying dynamic text

    As a slight variant to witchcrop's idea use StrPos() to locate the text, then SubStr() it out (plus a few characters) to locate the number. This assumes that the text is in one very large concatenated line.

    If the return from GetText() is a list of strings, a faster approach would be to use MatchStr() to locate the desired text line using a reverse loop.


    John


    ------------------


    [This message has been edited by John J. Miller (edited 08-23-2002).]

  4. #4
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Verifying dynamic text

    I'm betting Silk will throw an exception with GetText() but I could be mistaken on that. I believe it will say the text is "not unique."

    Will the "categories" always come back in the same order? What I mean is, do you know which dxci.claim.bl.XXXXX item you want, and will the report always come back in that same order? If so, you may be able to index your "non-Unique" text in an array as HtmlText("No. Connections Opened:*[2]") or something along that line.

    Am I making sense? Or no?

    ------------------

  5. #5
    Junior Member
    Join Date
    Jan 2002
    Location
    Irvine, CA, USA
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Verifying dynamic text

    Thanks all for the suggestions.

    GetText did not work for met. It only returned the text "DM STatistics" which is the main heading BUT none of the rest of the data, so I won't be able to get to the text "Total Open Connections: 0"

    I tried GetmultiText - it did return (Print) more than the heading but the rest of the data (although I couldn't read it).
    Any tips on GetmultiText ?

    DJGray,
    Pretty much the categories are returned in the same order BUT, the totals are different, sometimes not all the categories are listed, it depends on what part of the application is used before I run this systemstats utility.

    You have any sample code that I can use to start for the index tip you gave. I've never actually used it, it will be more helpful.

    Thank you gurus ...

    G



    ------------------

  6. #6
    Junior Member
    Join Date
    Jan 2002
    Location
    Irvine, CA, USA
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Verifying dynamic text

    Good news ! Using gettext tip (getmultitext) and then doing a matchstr I was able to locate the text "Total Open Connections: 0"

    Thanks gurus ! Another one bites the dust !

    G

    ------------------

  7. #7
    Junior Member
    Join Date
    Jan 2002
    Location
    Irvine, CA, USA
    Posts
    15
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Verifying dynamic text

    Hi gurus,

    Question ...

    See my code below which works sometimes and sometimes it errs out with :
    "Invalid Handle" and it fails at
    line "dcistats.TextTotal.GetMultiText ()"


    Any ideas why I would get this errmessage ?

    [ ] Browser.Maximize ()
    [ ] Browser.Location.SetText (sStatSite)//Redo
    [ ] Browser.Location.TypeKeys ("<Enter>")
    [ ]
    [ ] dcistats.SetActive ()
    [ ]
    [ ] list of string sAllText
    [ ]
    [ ] sAllText = dcistats.TextTotal.GetMultiText ()
    [ ] //print ({sAllText})
    [ ] integer i
    [ ] for i = 1 to ListCount (sAllText)
    [-] if (! MatchStr ("Total Open Connections: 0", sAllText[i]))
    [ ] LogError ("No Match ", sAllText[i])
    [-] else
    [ ] Print ("Pass String Total Open Connects: 0 is found in sAllText[i]",sAllText[i])


    ------------------

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin 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 05:28 AM.

Copyright BetaSoft Inc.