Can not verify encode text

4 posts, 0 answers
  1. Ha
    Ha avatar
    22 posts
    Member since:
    Apr 2012

    Posted 24 May 2012 Link to this post

    Hi all
    After I recorded verify step on IE
    I run it on firefox but it's not running because encode of string
    I corrected :  Pages.InachisHardwareAndChannels0.StartNbspMarkLabelTag.AssertContent().TextContent(ArtOfTest.Common.StringCompareType.Contains, WebUtility.HtmlDecode("Start Mark"));
    But it don't run.

    Please refer attachment
    Thanks so much
  2. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 28 May 2012 Link to this post

    Hello,
    you need to be careful with &nbps. IE renders it as blank space. Firefox does not render that element - instead its treated as regular text within the HTML code of the page. You need to work around this limitation:

    This can be a problem on two separate occasions:
    1) Find Expressions. If the find logic for an element is based on its text content. For instance:
    Text Content is exactly &nbpssometext
    you need to change that to
    Text Content contains sometext
    http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/elements-pane-overview/find-element.aspx

    2) Text Content Verifications:
    Verify Text Content is exactly &nbpssometext
    needs to be changed to
    Verify Text Content contains &sometext

    Greetings,
    Stoich
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  3. Ha
    Ha avatar
    22 posts
    Member since:
    Apr 2012

    Posted 28 May 2012 Link to this post

    Hi Stoich
    If Text Content Verifications:
    Verify Text Content is exactly &nbpssometext
    needs to be changed to
    Verify Text Content contains &sometext
    1- I must change test when I test on other brower. It's right?
    2- Otherwise, I know "contains compare type" is not exactly .
    For example: compare string (1) "HHa" and  string (2) "Ha"  with "Ha"
    If use exact ="Ha", only string (2) is correct
    But use contain ="Ha", both of them is correct
    Is it right?
  4. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 31 May 2012 Link to this post

    Hi,
    If Text Content Verifications:
    Verify Text Content is exactly &nbpssometext
    needs to be changed to
    Verify Text Content contains &sometext

    It needs to be changed to Verify Text Content contains sometext (without the '&').

    1- I must change test when I test on other brower. It's right? - No, the Contains will work on both browsers.

    2- Otherwise, I know "contains compare type" is not exactly .
    For example: compare string (1) "HHa" and  string (2) "Ha"  with "Ha"
    If use exact ="Ha", only string (2) is correct
    But use contain ="Ha", both of them is correct
    Is it right?

    Yes, this is correct!

    If you're worried that Contains is not specific enough for you - you can create two separate steps and configure each to run again a specific browser:
    http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/code-samples/general/browser-specific-actions.aspx

    Regards,
    Stoich
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top