but now I want my test to be data driven so I bound the verify test to my value for FirstName and the compare
type is set to contains and my expected value is still set to original recorded value.
but my test just seems to fail how to I get my test to verify that my text is 'Welcome to eZone, {FirstName value here}'
6 Answers, 1 is accepted
I just did a quick test against the telerik site (the "Hi, Your name" in the top span).
The only way I could see doing this, unless your data driving text is "Welcome to eZone, Nick" would be to convert the step do code and do the following:
I made a local data name with a single column called "Name" and put "Daniel Clark" in the first row.
// Verify 'InnerText' 'Contains' 'Hi, Daniel Clark' on 'HiSpan' - DataDriven: [$(Name)]
Pages.TelerikNETUIControls.HiSpan.AssertContent()
.InnerText(ArtOfTest.Common.StringCompareType.Contains,
(String.Format(
"Hi, {0}"
, (
string
)(System.Convert.ChangeType(Data[
"Name"
],
typeof
(
string
))))));
In your case, it would be more of
String.Format(
"Welcome to eZone, {0}"
, (
string
)(System.Convert.ChangeType(Data[
"DataDrivenName"
],
typeof
(
string
))))
Worth a shot.
Test Studio supports data driving verification through the UI. Try changing the CompareType to 'Exact' rather than 'Contains'. Does the verification pass? If not, make sure you're following the steps in the support document Attach Columns to Verifications.
If you're still having issues after changing the CompareType and following the steps in the article, I'll need more information to diagnose your issue. Attach a copy of a demo test that displays the behavior. I'll download it and determine why the verification is failing.
Rodney
Telerik
Test Studio Trainings
That's why support for string builder would be nice.
Thanks for the input. I've created a Feature Request to add support for string builder without code. You can comment on the feature and vote for its popularity here.
Also, be sure to check out our Extract Variable feature for extracting values from existing elements. This can be extremely helpful if you need to reuse extracted values later in your tests.
Rodney
Telerik
Test Studio Trainings