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

Verify multiline text box

3 Answers 89 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
algot
Top achievements
Rank 1
algot asked on 06 Jan 2012, 03:41 PM
I have multiline text box with 3 strings of text in it.

Number of Servers: 1
Number of Concurrent Users: 1-3
QuestionsComments:

If I record step with "verify" function test execution failed.

3 Answers, 1 is accepted

Sort by
0
Anthony
Telerik team
answered on 06 Jan 2012, 06:24 PM
Hello Alexander,

How does the verify fail? What are the Step Failure Details? The Export Result to File feature is the best way to send us that information.

If the test is against a public site, please attach the test files (within a .zip file) so we can see the failure first-hand.

This issue may be related to the way browsers render Special Characters differently. You may need to tweak the conditions of the verification so it consistently passes.

Kind regards,
Anthony
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
algot
Top achievements
Rank 1
answered on 10 Jan 2012, 09:37 AM
I replaced verification of 3 strings simultaneously with 3 consecutive verification one string at a time.

To reproduce my problem I tried to insert multiline text in verify step, but it impossible.
Then I try to use coded step:
Pages.ProspectSitecoreNet.FrameContentIFrame.SitecoreAdditionaldescriptionTextArea.AssertContent().TextContent(ArtOfTest.Common.StringCompareType.Contains, "Number of Servers: 1\nNumber of Concurrent Users: 1-3\nQuestionsComments:");
But step is failed:
ArtOfTest.Common.Design.Exceptions.ExecutionException: Exception thrown executing coded step: '[PricingForm_CodedStep] : Verify 'TextContent' on 'SitecoreAdditionaldescriptionTextArea''. ---> ArtOfTest.Common.Exceptions.AssertException: String match failed (CompareType:Contains). - [Expected:Number of Servers: 1
Number of Concurrent Users: 1-3
QuestionsComments:],[Actual:Number of Servers: 1
Number of Concurrent Users: 1-3
QuestionsComments:
]
   at ArtOfTest.WebAii.Controls.BaseControlAssert`1.Assert(Boolean condition, String message, String expected, String actual, Boolean throwAssert)
   at ArtOfTest.WebAii.Controls.BaseControlAssert`1.AssertString(String expected, String actual, StringCompareType compareType, Boolean throwOnFailure)
   at ArtOfTest.WebAii.Controls.HtmlControls.HtmlAsserts.AssertContent.TextContent(StringCompareType compareType, String expectedValue)
   at Portal_CRM.PricingForm.PricingForm_CodedStep() in c:\Users\ago.DK\Documents\Test Studio Projects\Portal_CRM\PricingForm.tstest.cs:line 292
   --- End of inner exception stack trace ---
   at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.InternalExecuteSteps(AutomationStepList stepList, TestResult testResult, Object codeBehindInstance, Boolean& stopExecution)
0
Anthony
Telerik team
answered on 10 Jan 2012, 05:36 PM
Hello Alexander,

Breaking that single verification into three is probably the best approach.

As you can see from the Expected vs. Actual strings in the error message, the browser is rendering those strings slightly differently during execution, as I initially expected.

Greetings,
Anthony
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
algot
Top achievements
Rank 1
Answers by
Anthony
Telerik team
algot
Top achievements
Rank 1
Share this question
or