You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I implemented a script that imports all the tests from XML files. Each XML is one test case.
When I re-import an existing test (due to a test update, for example), instead of checking and updating all steps, I made it simple: I delete all the steps and re-import them from scratch.
Now, the issue is that I cannot delete all the steps. If I have 4 steps, for example, I can delete step 4,3,2; then, when I try to delete the last one (with index 0), I get the following error.
Traceback (most recent call last): File "/home/mark/testing/polarion/import_test_cases.py", line 56, in <module> add.perform() File "/home/mark/testing/polarion/import_test_cases.py", line 40, in perform import_xml.import_single_testcase(self.client, self.project, self.directory + x, workitems) File "/home/mark/testing/polarion/import_xml.py", line 76, in import_single_testcase workitem.removeTestStep(i) File "/home/mark/.local/lib/python3.10/site-packages/polarion/workitem.py", line 612, in removeTestStep service.setTestSteps(self.uri, self._polarion_test_steps.steps.TestStep) File "/home/mark/.local/lib/python3.10/site-packages/zeep/proxy.py", line 46, in __call__ return self._proxy._binding.send( File "/home/mark/.local/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 123, in send envelope, http_headers = self._create( File "/home/mark/.local/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 73, in _create serialized = operation_obj.create(*args, **kwargs) File "/home/mark/.local/lib/python3.10/site-packages/zeep/wsdl/definitions.py", line 224, in create return self.input.serialize(*args, **kwargs) File "/home/mark/.local/lib/python3.10/site-packages/zeep/wsdl/messages/soap.py", line 79, in serialize self.body.render(body, body_value) File "/home/mark/.local/lib/python3.10/site-packages/zeep/xsd/elements/element.py", line 232, in render self._render_value_item(parent, value, render_path) File "/home/mark/.local/lib/python3.10/site-packages/zeep/xsd/elements/element.py", line 256, in _render_value_item return self.type.render(node, value, None, render_path) File "/home/mark/.local/lib/python3.10/site-packages/zeep/xsd/types/complex.py", line 307, in render element.render(node, element_value, child_path) File "/home/mark/.local/lib/python3.10/site-packages/zeep/xsd/elements/indicators.py", line 256, in render element.render(parent, element_value, child_path) File "/home/mark/.local/lib/python3.10/site-packages/zeep/xsd/elements/element.py", line 226, in render self.validate(value, render_path) File "/home/mark/.local/lib/python3.10/site-packages/zeep/xsd/elements/element.py", line 264, in validate raise exceptions.ValidationError( zeep.exceptions.ValidationError: Expected at least 1 items (minOccurs check) 0 items found. (setTestSteps.testSteps)
The code I used is a simple loop (I tried few solutions):
// if the workitem exists, all the steps are deleted, before re-importing them
if exists:
if workitem.hasTestSteps():
i = len(workitem.getTestSteps()) - 1
logging.info("tot steps: " + str(len(workitem.getTestSteps())))
while i >= 0:
logging.info("i = " + str(i))
workitem.removeTestStep(i)
i -= 1
The text was updated successfully, but these errors were encountered:
Hi,
Looks like zeep did not get the correct minimum in an array. I've create a patch for this and this will be released soon. Look at the commit if you need the solution sooner.
I implemented a script that imports all the tests from XML files. Each XML is one test case.
When I re-import an existing test (due to a test update, for example), instead of checking and updating all steps, I made it simple: I delete all the steps and re-import them from scratch.
Now, the issue is that I cannot delete all the steps. If I have 4 steps, for example, I can delete step 4,3,2; then, when I try to delete the last one (with index 0), I get the following error.
Traceback (most recent call last): File "/home/mark/testing/polarion/import_test_cases.py", line 56, in <module> add.perform() File "/home/mark/testing/polarion/import_test_cases.py", line 40, in perform import_xml.import_single_testcase(self.client, self.project, self.directory + x, workitems) File "/home/mark/testing/polarion/import_xml.py", line 76, in import_single_testcase workitem.removeTestStep(i) File "/home/mark/.local/lib/python3.10/site-packages/polarion/workitem.py", line 612, in removeTestStep service.setTestSteps(self.uri, self._polarion_test_steps.steps.TestStep) File "/home/mark/.local/lib/python3.10/site-packages/zeep/proxy.py", line 46, in __call__ return self._proxy._binding.send( File "/home/mark/.local/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 123, in send envelope, http_headers = self._create( File "/home/mark/.local/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 73, in _create serialized = operation_obj.create(*args, **kwargs) File "/home/mark/.local/lib/python3.10/site-packages/zeep/wsdl/definitions.py", line 224, in create return self.input.serialize(*args, **kwargs) File "/home/mark/.local/lib/python3.10/site-packages/zeep/wsdl/messages/soap.py", line 79, in serialize self.body.render(body, body_value) File "/home/mark/.local/lib/python3.10/site-packages/zeep/xsd/elements/element.py", line 232, in render self._render_value_item(parent, value, render_path) File "/home/mark/.local/lib/python3.10/site-packages/zeep/xsd/elements/element.py", line 256, in _render_value_item return self.type.render(node, value, None, render_path) File "/home/mark/.local/lib/python3.10/site-packages/zeep/xsd/types/complex.py", line 307, in render element.render(node, element_value, child_path) File "/home/mark/.local/lib/python3.10/site-packages/zeep/xsd/elements/indicators.py", line 256, in render element.render(parent, element_value, child_path) File "/home/mark/.local/lib/python3.10/site-packages/zeep/xsd/elements/element.py", line 226, in render self.validate(value, render_path) File "/home/mark/.local/lib/python3.10/site-packages/zeep/xsd/elements/element.py", line 264, in validate raise exceptions.ValidationError( zeep.exceptions.ValidationError: Expected at least 1 items (minOccurs check) 0 items found. (setTestSteps.testSteps)
The code I used is a simple loop (I tried few solutions):
// if the workitem exists, all the steps are deleted, before re-importing them
if exists:
if workitem.hasTestSteps():
i = len(workitem.getTestSteps()) - 1
logging.info("tot steps: " + str(len(workitem.getTestSteps())))
while i >= 0:
logging.info("i = " + str(i))
workitem.removeTestStep(i)
i -= 1
The text was updated successfully, but these errors were encountered: