How to be backward compatible when removing a property from TestStep

My plugin has been released to customers.
Now, I am doing enhancements to the plugin, I want to remove one property in one TestStep, which has been released in the first release.

However, if I load a legacy TapPlan, it will report error message, like:
11:49:59.075 Serializer XML Line 103: Unable to read element ‘UsbCt’. The property does not exist.

I understand why the error is reported, and there is way for user to ignore the message.
But this may confusing customer; so I am wondering if there is a way to turn off such error message when loading tap plan file.

1 Like

Just found one workaround,
instead of removing the property, I can just mark it with [XmlIgnore] attribute and leave it.

If you have a better way to handle such case, I would like to hear.

1 Like

I dont know if your customers can create or save test plans, but you can save the loaded legacy test plan to serialize it with your current class. This will overwrite the .TapPlan file and your old property will not be shown. My suggestion would be update the test plans and send them to your customers.

1 Like

Thanks for the suggestion!
My customers can create/save test plans, and I will re-generate the default test plan files in the new release.

2 Likes

@ya-ping_zhang I think your solution works fine. In our case, we have moved old steps to a “Legacy” group, so that they are still accessible, but more hidden:

Thanks for your reply!

1 Like