Verify displayed test step data driven and hardcoded value mix

1 Answer 27 Views
Elements Test Recording WPF Testing
Nathan
Top achievements
Rank 1
Nathan asked on 21 Nov 2024, 02:33 PM

I am creating something with a name of zxcvb using the generate random string test step. Then I'm validating that that string is visible in an element. However in the element there is some space between the beginning of the generated name, so I get failure information in my logs like this

Failure Information:
~~~~~~~~~~~~~~~
Displayed text did not satisfy constraint(    t0Xhs Same t0Xhs)

my test looks like

'Pass' : 6. Type '' into Item0Bstextbox - DataDriven: [$(test-search)][$(test-search)]
'Pass' : 7. Click OKRadbutton
'Fail' : 10. Verify 'SearchNameTextblock' displayed text Same '   ' - DataDriven: [$(test-search)]

so in step 10, I need to add some spaces in ahead of the data driven value

1 Answer, 1 is accepted

Sort by
1
Accepted
Elena
Telerik team
answered on 22 Nov 2024, 08:26 AM

Hi Nathan,

As far as I see the verify is step is set to check exact match. However, that blank space in the textBlock text makes the exact verification fail. You can set the step to check if the displayed text contains the random string. This is part of the step properties and is available in the quick access when you double click the step to expand it. 

Please, give this a try and let me know if it fits your needs.

Regards,
Elena
Progress Telerik

Virtual Classroom is the free self-paced technical training portal that gets you up to speed with Telerik and Kendo UI products including Telerik Test Studio! Check it out at https://learn.telerik.com/.
Nathan
Top achievements
Rank 1
commented on 22 Nov 2024, 10:44 AM

Thanks Elena, That would be great. But I don't seem to have that dropdown box with my test
Elena
Telerik team
commented on 22 Nov 2024, 11:16 AM

Hi Nathan, 

Please, check the step properties pane and what options are listed there for this step. if you still don't see suitable option, please, share a screenshot of these.

Regards,
Elena 

Nathan
Top achievements
Rank 1
commented on 22 Nov 2024, 01:50 PM

ah yes I do, that's grand thank you, I have the comparison field there and can switch that over to Contains
Elena
Telerik team
commented on 22 Nov 2024, 02:01 PM

Hi Nathan, 

Thanks for the follow up! I am pleased to know this worked for you.

Regards,
Elena

Tags
Elements Test Recording WPF Testing
Asked by
Nathan
Top achievements
Rank 1
Answers by
Elena
Telerik team
Share this question
or