Results 1 to 3 of 3
  1. #1

    how to verify dynamic html text

    Hello all,

    using silk7.0, ie6.0

    I am getting a problem w/ verifying dynamic text.

    on the returned page I am trying to verify the price value that changes depending on a package under test. The expected value is read in from a file.

    When I record and do VerifyProperties

    in the frame file its recorded as:

    [-]window BrowserChild BrowserChildName
    [ ] tag "tag name here"
    [ ] parent Browser

    [-] HtmlText TextToVerify
    [ ] tag "1.99"

    in the .t file:
    BrowserChildName.TextToVerify.VerifyProperties ({...})
    [ ] ""
    [-] {...}
    [ ] {"Text", "{TestPackage.sRenewalPrice}"}
    [ ]

    The problem here is this, the TestPackage.sRenewalPrice is always changing but the tag in the frame file is always 1.99 So how do I pick up this value on the fly (actual price returned on the page) and compare it to TestPackage.sRenewalPrice(expected) ?

    Or how do I manipulate the frame file so the tag can be dynamic?

    Thanks in advance.

    btw, I tried declaring TextToVerify as a DynamicText class and used BrowserChildName.TextToVerify.VerifyValue(TestPack age.sTerm) but still getting an exception thrown

  2. #2

    Re: how to verify dynamic html text


    You can change the tag of the "TextToVerify" to an index tag, if you know the relative position (unique to the HtmlText class) of the text you want to verify and if it is not change time to time.

    E.g. If the "TextToVerify" is the 10th text element of your page always,

    [-]window BrowserChild BrowserChildName
    [ ] tag "tag name here"
    [ ] parent Browser

    [-] HtmlText TextToVerify
    [ ] tag "#10"

    [ 10-07-2004, 08:25 PM: Message edited by: harshakapila ]

  3. #3

    Re: how to verify dynamic html text

    Do TextToVerify.GetText() and compare it with
    If that does not work, try
    TextToVerify.GetCaption() and compare with TestPackage.sRenewalPrice.
    Or if You want the tag to be taken dynamically, keep the tag of TextToVerify as GetCaption() as follows:
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">HtmlText TextToVerify
    tag {GetCaption()}</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">I am not 100% sure abt the last one.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 04:13 PM.

Copyright BetaSoft Inc.