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

Data Driven Validation

6 Answers 102 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Andrew
Top achievements
Rank 1
Veteran
Iron
Andrew asked on 18 Oct 2013, 04:12 PM
ok I created a Verify test when I initial recorded my test to verify this text 'Welcome to eZone, Nick'
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

Sort by
0
Accepted
Daniel
Top achievements
Rank 2
answered on 18 Oct 2013, 05:53 PM
Without seeing the failure message from the log, it will be a bit harder to diagnose what the exact issue is.

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.
0
Andrew
Top achievements
Rank 1
Veteran
Iron
answered on 21 Oct 2013, 02:25 PM
thanks, it would be nice if you could do this right in the UI, like you can do with their controls
0
Daniel
Top achievements
Rank 2
answered on 21 Oct 2013, 02:27 PM
I agree.  If there is a way currently, I am not aware of it and would love for Telerik support to let us know!
0
Rodney
Telerik team
answered on 23 Oct 2013, 04:14 PM
Hi Andrew,

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. 

Regards,
Rodney
Telerik
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Andrew
Top achievements
Rank 1
Veteran
Iron
answered on 24 Oct 2013, 01:06 PM
but doing an exact match will not work because I build the value I want to validate is a combination of static and data driven values.
That's why support for string builder would be nice.
0
Rodney
Telerik team
answered on 29 Oct 2013, 03:44 PM
Hi Andrew,

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.

Regards,
Rodney
Telerik
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Andrew
Top achievements
Rank 1
Veteran
Iron
Answers by
Daniel
Top achievements
Rank 2
Andrew
Top achievements
Rank 1
Veteran
Iron
Rodney
Telerik team
Share this question
or