Avoid blank values in excel while validating

api_testerapi_tester Posts: 22

Hi Team,

How to avoid blank values in data sheet while validating or during assertion.

example : Attached an excel.

I need to skip the blank cells in excel while testing.

Note : I cannot edit the datasheet.

Tagged:

Comments

  • api_testerapi_tester Posts: 22

    Hi Team, any update on the given query.

  • jakubiakjakubiak Posts: 684 admin

    In your assertor, create a conditional assertion that uses a custom assertion for the "if" and a value assertion for the "then". The value assertion will simply be parameterized against a column in the data source as normal. The custom assertion will define a simple script that will read from the data source column and will only pass if the value is non-empty. Be sure to check the "Use data source" box in the custom assertion. Here is a simple Groovy script that could work for the custom assertion:

    public boolean checkDS(input, context) {
        value = context.getValue("MyDS", "ID2")
        return value != null && !("".equals(value));
    }
    
Sign In or Register to comment.