Comparing text from data

6 posts, 0 answers
  1. Cheryl
    Cheryl avatar
    45 posts
    Member since:
    Jul 2006

    Posted 01 Apr 2012 Link to this post

    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?
  2. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 05 Apr 2012 Link to this post

    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
  3. Cheryl
    Cheryl avatar
    45 posts
    Member since:
    Jul 2006

    Posted 09 Apr 2012 Link to this post

    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
  4. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 12 Apr 2012 Link to this post

    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
  5. Cheryl
    Cheryl avatar
    45 posts
    Member since:
    Jul 2006

    Posted 17 Apr 2012 Link to this post

    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)
  6. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 18 Apr 2012 Link to this post

    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
Back to Top