Data Driven Tests with variable Assertion
Hello,
I'm creating data driven tests and ran into the following scenario: For each test case, I need to test for the presence of a specific elements in a list. The issue is that for some cases I'm looking for a single element, for others I have 2 or more elements to test. I could seperate out test cases that have 1, 2 etc. assertions, but I'm wondering if theres a way to run all these test in a single test case. For example, is there a way to activate an assertion if there is a value present in my data file?
Thanks!
Thanks for the reply, I think that could work but I just realized when asserting for content (Contains) if I leave the field blank in my data source, it will work (I guess testing for an empty tag?). So for a small set it would be practicle to setup additional columns in my data source (value1, value2, value 3, etc) and have those columns populated with the required values if present. This would avoid having to create a specific groovy script for the assertion by the testers.
Thanks!