Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Avoid blank values in excel while validating

Options
api_tester
api_tester Posts: 28

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_tester
    api_tester Posts: 28
    Options

    Hi Team, any update on the given query.

  • jakubiak
    jakubiak Posts: 798 admin
    Options

    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));
    }