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

Comparing text from data

5 Answers 130 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Cheryl
Top achievements
Rank 1
Cheryl asked on 02 Apr 2012, 04:20 AM
What is the recommended way of comparing text between a data string and what is in the div/label/whatever?

I've got an issue where there looks to be a soft return within a string in the data but Test Studio is not picking up on this

Ie when I view source code of the page it has shows in line break within the text string but which is not represented with any html characters

From the error log:
[Expected:An excess of $100.00 applies to all claim events under the policy, unless the No Excess option
has been selected, in which case there will be no excess charged on each claim.],

[Actual:An excess of $100.00 applies to all claim events under the policy, unless the No Excess option has been selected, in which case there will be no excess charged on each claim.]

Any suggestions?

5 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 05 Apr 2012, 08:17 PM
Hi Cheryl,

I apologize for the delay responding back to you.

Looking at your Expected string I see a hard break in it. In other words the HTML actually looks like this:

An excess of $100.00 applies to all claim events under the policy, unless the No Excess option<br>has been selected, in which case there will be no excess charged on each claim.

But looking at the Actual string this <br> is missing. My suggestion is to remove this <br> from the expected string and (if not already set) change the verification to InnerText.

Also, I'm not sure what you mean by a "soft return". Can you clarify this and give me some examples? The actual HTML behind it would also be helpful. Right click on the browser and select View Source to get at the raw HTML.

Kind regards,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Cheryl
Top achievements
Rank 1
answered on 10 Apr 2012, 12:06 AM
Hi Cody

Sorry, I meant a break in general - as there is no html code representing the <br>

From the browser source code it show like this:

An excess of $100.00 applies to all claim events under the policy, unless the No Excess option
has been selected, in which case there will be no excess charged on each claim.

And looking directly at the data via SQL, there are no characters showing that represent this break either. 

I've had to do a replace of CHAR(13) and CHAR(10) in the sql statement in order to remove these "invisible" characters
0
Cody
Telerik team
answered on 12 Apr 2012, 11:46 PM
Hi Cheryl,

Maybe I'm not fully understanding what you're asking. <br> is real HTML code. It's the only thing that can force a line break to be displayed in the browser. If there's no <br> in the HTML source code, the browser will not insert a line break... except it will break on words when the word will not fit on the current row. However this type of break will not affect Test Studio verification's. Perhaps seeing this via GoToMeeting where you can demonstrate the problem to me and we can discuss it would help. Let me know what time zone you are in and your availability and I'll setup the meeting. I'm in Austin, TX which is Central Time (GMT -6).

Kind regards,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Cheryl
Top achievements
Rank 1
answered on 17 Apr 2012, 11:48 PM
Hi Cody

I agree that it looks like there is a <br> forcing the line break in the text, BUT when you view the html source in the browser there is no <br> anywhere within the text.

Cheryl

(Sorry don't have GoToMeeting)
0
Cody
Telerik team
answered on 18 Apr 2012, 02:54 PM
Hello Cheryl,

GoToMeeting is an oniine screen sharing/meeting application.  I have a paid GoToMeeting account. When I setup a meeting there is no cost to you. You will need to install a very small client, but that is very quick and easy. All you need to do is click on the link of a GoToMeeting invite to have the client automatically installed and join the online meeting. It really is simple and painless.

I still would very much like to see and discuss your problem first hand. Let me know what time works for you and I'll setup the online meeting (at no cost to you).

Kind regards,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Cheryl
Top achievements
Rank 1
Answers by
Cody
Telerik team
Cheryl
Top achievements
Rank 1
Share this question
or