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.

test name parameterization

Gunel2316
Gunel2316 Posts: 2

I have one payload with different vallues and headers. I created data source and added headers and values and also added column Test name. is there any ways to parameterize each test name so that test picks only headers and other values related to its name?

Comments

  • benken_parasoft
    benken_parasoft Posts: 1,302 ✭✭✭
    edited December 2019

    is there any ways to parameterize each test name so that test picks only headers and other values related to its name?

    Not exactly. You use a data source when you want to run a test or a scenario repeatedly in a loop where each iteration uses values from a different data source row. Otherwise, if this is a test or scenario that is being executed once, where some tests are similar but use different values, then you would probably wouldn't use a data source but maybe use environment variables or test suite variables.

    If you want to have different tests reference the same variable then you could add a test step between those test cases that modifies the value. You can change test variable values programmatically using the Extension Tool:
    Setting Variables and Logic Through Scripting

    There are also various ways to create reusable/modular tests or test suites. This is accomplished using tool references or test suite references. The shared test/suite can reference test suite variables defined by the referencing suite:
    Reusing and Modularizing Test Suites for End-to-end Testing
    Creating Reusable (Modular) Test Suites

  • Gunel2316
    Gunel2316 Posts: 2

    I see. is there a way then for example I have 5 tests in a suite, and data source excel file with 25 variables (5 sets with different headers and variables). can my 5 tests from the suite run first 5 set, then second, then third and etc. for example test 1, row 1, test 2, row 2, test 3, row 3 etc. up to row 5,
    then test 1, row 6, test 2, row 7, test 3, row 8 up to row 10
    then test 1 row 11, test 2 row 12 etc

  • benken_parasoft
    benken_parasoft Posts: 1,302 ✭✭✭

    No, tests and data sources in SOAtest behave differently than how you describe. Here's some information and detail in case this helps you:
    Understanding How SOAtest Performs Functional Testing Using Data Sources
    Specifying Execution Options > Test Relationship

  • goofy78270
    goofy78270 Posts: 133

    @Gunel2316 , based on you last comment, are you simply looking to run the same test over different portions of the data given some other characteristic? It appears like you want to run test 1 thru 12, but unsure what the switch is, or reason for, the grouping of the 5 rows at a time.

    Based on your original post, I would say create a test suite variable that pulls from the datasource column of the test name. Then use that variable to condition runs using test flow logic where that variable = the test run name.