Multiple whitespace not parsed correctly

7 posts, 1 answers
  1. Silvio
    Silvio avatar
    52 posts
    Member since:
    Dec 2012

    Posted 24 Apr 2013 Link to this post

    Hi,

    I thought I had already reported this issue long time ago, but seemingly I haven't..

    When there is multiple whitespace in a text like this

    <span>That's the     text</span>

    and you try to get this span with

    browser.Find.ByExpression<HtmlSpan>("TextContent=That's the text");

    it doesn't work, even if this is the text you will see on the website. All browsers ignore multiple whitespace in html, so I think the framework should also natively do so.

    I solved it with custom GetInnerText()- and GetTextContent()- methods which automatically remove multiple whitespace and then convert &nbsp;.

    Kind Regards
    Silvio
  2. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 25 Apr 2013 Link to this post

    Hello Silvio,

    I am sorry to hear you are experiencing this problem. I have tried to reproduce it locally, but as you can see in this video, I wasn't able to do so. What am I doing differently? Can you please record a Jing video demonstrating the issue? Also please ensure you're using the latest version of our Framework, which is 2012.2.1527. You can download from your Telerik.com account here: Public URL.

    Regards,
    Plamen
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  3. Silvio
    Silvio avatar
    52 posts
    Member since:
    Dec 2012

    Posted 26 Apr 2013 Link to this post

    Hi Plamen,

    thanks for your answer!

    Sorry, I insufficient investigated this issue. I created a test site like you did and also couldn´t reproduce it. In the end I got the hint that this could be due to Doctype. And that's it.

    This problem just occurs when using XHTML 1.0 Transitional Doctype.

    Kind Regards
  4. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 30 Apr 2013 Link to this post

    Hello Silvio,

    The way our Testing Framework works is to locate every single element in the DOM (for HTML applications) and the Silverlight Visual Tree for Silverlight applications. We can examine and verify any attribute that appears in the DOM/Visual Tree, including the text contained in those elements. In your case, when you're using multiple white-spaces(in XHTML 1.0 Transitional Doctype), the text visually appears without those spaces, however if you examine the DOM tree for that element you'll notice that the white spaces are still there and that's exactly how our Framework see the text content of that Span element. See the attached screenshot for more information.   

    Regards,
    Plamen
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  5. Silvio
    Silvio avatar
    52 posts
    Member since:
    Dec 2012

    Posted 30 Apr 2013 Link to this post

    Hi Plamen,

    Yes, I already noticed this. But I thought maybe this should be changed, so that the framework sees the text like it looks for the user.
    However, this is no big problem as it is easily solvable by writing custom methods (but I had to spend some time to realize that this was the problem when I wasn´t able to get a link by it's text, and I think I'm not the only one).

    Kind Regards
    Silvio
  6. Answer
    Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 30 Apr 2013 Link to this post

    Hi Silvio,

    Thanks for your feedback. We have a new feedback portal where anyone with a Telerik.com account can create feature requests and problem reports. Would you mind creating your own feature request in your own words about this? Our development team will review your request and consider whether to implement this in one of our future releases.

    Regards,
    Plamen
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  7. Silvio
    Silvio avatar
    52 posts
    Member since:
    Dec 2012

    Posted 02 May 2013 Link to this post

    Hi Plamen,

    Thanks for your answer. I'll create a feature request.

    Kind Regards
    Silvio
Back to Top