This is a migrated thread and some comments may be shown as answers.

Multiple whitespace not parsed correctly

6 Answers 59 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Silvio
Top achievements
Rank 1
Silvio asked on 24 Apr 2013, 07:47 AM
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

6 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 25 Apr 2013, 02:55 PM
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
0
Silvio
Top achievements
Rank 1
answered on 26 Apr 2013, 10:44 AM
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
0
Plamen
Telerik team
answered on 30 Apr 2013, 02:18 PM
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
0
Silvio
Top achievements
Rank 1
answered on 30 Apr 2013, 02:43 PM
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
0
Accepted
Plamen
Telerik team
answered on 30 Apr 2013, 03:06 PM
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
0
Silvio
Top achievements
Rank 1
answered on 02 May 2013, 07:31 AM
Hi Plamen,

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

Kind Regards
Silvio
Tags
General Discussions
Asked by
Silvio
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Silvio
Top achievements
Rank 1
Share this question
or