Forum Discussion

ahart's avatar
ahart
Occasional Contributor
10 years ago

Dynamic Schema Compliance Assertions?

So, I have a test case that I original created step by step. On the steps that send requests, I originally added some Schema compliance assertions. This is my "modular" test case.

Once I had the thing set up the way I wanted, I then added some test case properties to "parameterize" the test case passing in the names of the operations I want to invoke. I then call this test case from another using the "Run TestCase" test step. My modular test case setup script then rebuilds the request to hit the operations I passed in.

The schema compliance assertions fail because it is looking for message parts for the request that I used when I was originally creating them; i.e., it does not look at the modified request that was actually sent and validate the response against that. It validates against the hard coded request I used when I was originally creating this "modular" test case. What's weird is that, even if I pull that test step up, delete the schema compliance assertion, and re-add it, it still wants to use the original value, even though the request has already been changed. Thinking that perhaps this is because it's working off something cached (which has bitten me more times than I care to list), I even save the project, close it, open it back up, and try to delete/re-add the schema compliance assertion. But it still fails, looking for the response to the original operation. I don't get it.

I see nothing to configure on these "Schema Compliance" assertions, other than the URL of the WSDL to validate against. But, obviously, they retain some other information from the time when they were created.

Is it possible to do this dynamically?

1 Reply

  • ahart's avatar
    ahart
    Occasional Contributor
    Ok, so I noticed that the "default" properties for the test steps in my "modular" test case are set to a specific WSDL operation: the one that I used when I initially created them, before I "modularized" it.

    I see that this "Operation" parameter cannot be edited directly in the "Properties" pane, like many of the other default properties. From the "Navigator" pane, I can select the "Change Operation" command from the context menu. So, I am guessing this is why my Schema Compliance assertion is validating the response against the wrong WSDL operation.

    Is there a way to change the "Operation" default property of a test step programmatically?