updateTestCase delete whole project when steps in parameters

Discussion and information for XML-RPC interface.

Moderators: Amaradana, TurboPT, TL Developers

updateTestCase delete whole project when steps in parameters

Postby jaracic » Fri Jul 31, 2015 12:07 pm

Hi,

I have a situation using updateTestCase function. If I put a steps array XML structure in the XML parameters, the function seems to delete the whole project !!!
Does anyone had this situation also ?
I think the XML strucutre for steps is OK because I use the same one (same code) to produce the XML steps part use by the function createTestCase.

I use TestLink 1.9.13

Before investigating the PHP code (I'm not a PHP developer at all...) and create a bug tracker in mantis I would like to share that.


Thanks for your help
Regards.
Joseph
jaracic
TestLink user
 
Posts: 4
Joined: Thu Jul 30, 2015 6:29 pm

Re: updateTestCase delete whole project when steps in parame

Postby fman » Fri Jul 31, 2015 6:02 pm

without detailed steps to reproduce with sample data nothing can be done
fman
Member of TestLink Community
 
Posts: 3024
Joined: Tue Nov 15, 2005 7:19 am

Re: updateTestCase delete whole project when steps in parame

Postby jaracic » Mon Aug 03, 2015 2:13 pm

Hi,

Actually this behavior occurs EVERY times on very basic data...
I asked in this forum to know if the updateTestCase has been already used to modify steps of an existing test case that have already steps...
I wondered if the XML structure of steps must be the same that the one used for the createTestCase function...

The scenario is very simple :
1/ I create with createTestCase a TestCase with Steps
2/ I modify fo the created testcase some attributes of its steps (I do not create new steps neither deleting some)

==> The project is deleted !!

Of course I can produced a XML streams traces to illustrate this basic scenario that provokes the Project deletion. Is is what you mean by "detailed steps".

Thanks for your help.
Joseph.
jaracic
TestLink user
 
Posts: 4
Joined: Thu Jul 30, 2015 6:29 pm

Re: updateTestCase delete whole project when steps in parame

Postby fman » Mon Aug 03, 2015 5:51 pm

detailed steps means all that is needed to create same scenario, starting from
1) create test project
2) create test suite
and so on

same apply for changes you are done on the ' some attributes' that you do not have clearly detailed

In anycase please do your tests with latest code from github

Just for the records: avoid as much as possible the ..., style that provide no info, no value, nothing
fman
Member of TestLink Community
 
Posts: 3024
Joined: Tue Nov 15, 2005 7:19 am

Re: updateTestCase delete whole project when steps in parame

Postby jaracic » Tue Aug 04, 2015 11:26 am

Hi,

I just made some tests with my code on a new test project;
You'll find below the commented XML trace (partial, I did not provided all XML traces - for the moment -, only those related to updateTestCase function)

Actually the problem is "nastier" that I thought.

In this new project I created manually with only one Test Suite
I created via XML RPC API a TC with steps : OK
I updated via XML RPC API this TC (its steps) : OK ... BUT a another project has been deleted !!!!

I created some other projects,
redo the update via XML RPC API this TC (its steps) : OK !!!! no project has been deleted !!!

It seems that updateTestCase (with steps in params) deletes the Project with id=1 !!!!

I have to restore the server to confirm that once again, but I think it's a clue.... If I reproduce several times that, I think I'll create a tracker in Mantis.

Unfortunalety I don't have IT access to update the testLink installation...

below the XML TRACE:
Code: Select all
<!-- Empty Project (315) with only one test plan and only one testsuite created (317)-->
<!-- Creation of the testCase -->
<methodCall><methodName>tl.createTestCase</methodName><params><param><value><struct><member><name>actiononduplicatedname</name><value><string>block</string></value></member><member><name>authorlogin</name><value><string>john.doe</string></value></member><member><name>checkduplicatedname</name><value><string>true</string></value></member><member><name>devKey</name><value><string>b2bdf05f63744524b90483f0ba5634b6</string></value></member><member><name>importance</name><value><string>2</string></value></member><member><name>order</name><value><string>0</string></value></member><member><name>preconditions</name><value><string>
   Test SIM with PIN inserted, SS is set to emulate a 2G/3G cell +</string></value></member><member><name>summary</name><value><string>
   The test case checks DUT behavior when xxx+</string></value></member><member><name>testcasename</name><value><string>PS_REG Counter 0</string></value></member><member><name>testprojectid</name><value><string>315</string></value></member><member><name>testsuiteid</name><value><string>317</string></value></member><member><name>execution</name><value><int>0</int></value></member><member><name>steps</name><value><array><data><value><struct><member><name>step_number</name><value><string>1</string></value></member><member><name>actions</name><value><string>Test SIM with PIN inserted, SS is set to emulate a 2G/3G cell</string></value></member><member><name>expected_results</name><value><string></string></value></member><member><name>execution_type</name><value><string>1</string></value></member></struct></value><value><struct><member><name>step_number</name><value><string>2</string></value></member><member><name>actions</name><value><string>Test SIM with PIN inserted, SS is set to emulate a 2G/3G cell</string></value></member><member><name>expected_results</name><value><string>OK</string></value></member><member><name>execution_type</name><value><string>1</string></value></member></struct></value><value><struct><member><name>step_number</name><value><string>3</string></value></member><member><name>actions</name><value><string>Configure Network Friendly Mode blabla</string></value></member><member><name>expected_results</name><value><string>OK</string></value></member><member><name>execution_type</name><value><string>1</string></value></member></struct></value><value><struct><member><name>step_number</name><value><string>4</string></value></member><member><name>actions</name><value><string>Configure Network Friendly Mode (maximum number of ...)</string></value></member><member><name>expected_results</name><value><string>OK</string></value></member><member><name>execution_type</name><value><string>2</string></value></member></struct></value><value><struct><member><name>step_number</name><value><string>5</string></value></member><member><name>actions</name><value><string>Trigger PS detach from the DUT</string></value></member><member><name>expected_results</name><value><string>OK</string></value></member><member><name>execution_type</name><value><string>1</string></value></member></struct></value></data></array></value></member></struct></value></param></params></methodCall>

<methodResponse>
   <params>
      <param>
         <value>
            <array><data>
                  <value><struct>
                        <member><name>operation</name><value><string>createTestCase</string></value></member>
                        <member><name>status</name><value><boolean>1</boolean></value></member>
                        <member><name>id</name><value><string>318</string></value></member>
                        <member><name>additionalInfo</name><value><struct>
                                 <member><name>id</name><value><string>318</string></value></member>
                                 <member><name>external_id</name><value><string>1</string></value></member>
                                 <member><name>status_ok</name><value><int>1</int></value></member>
                                 <member><name>msg</name><value><string>ok</string></value></member>
                                 <member><name>new_name</name><value><string></string></value></member>
                                 <member><name>version_number</name><value><int>1</int></value></member>
                                 <member><name>has_duplicate</name><value><boolean>0</boolean></value></member>
                                 <member><name>external_id_already_exists</name><value><boolean>0</boolean></value></member>
                                 <member><name>update_name</name><value><boolean>0</boolean></value></member>
                                 <member><name>tcversion_id</name><value><string>319</string></value></member>
                              </struct></value></member>
                        <member><name>message</name><value><string>Success!</string></value></member>
                     </struct></value>
               </data></array>
         </value>
      </param>
   </params>
</methodResponse>

<!--  Now I update some steps attributes -->

<methodCall><methodName>tl.updateTestCase</methodName><params><param><value><struct><member><name>devKey</name><value><string>b2bdf05f63744524b90483f0ba5634b6</string></value></member><member><name>testcaseexternalid</name><value><string>BUGUTC-1</string></value></member><member><name>version</name><value><int>1</int></value></member><member><name>steps</name><value><array><data><value><struct><member><name>step_number</name><value><string>1</string></value></member><member><name>actions</name><value><string>Test SIM with PIN inserted, SS is set to emulate a 2G/3G cell</string></value></member><member><name>expected_results</name><value><string></string></value></member><member><name>execution_type</name><value><string>1</string></value></member></struct></value><value><struct><member><name>step_number</name><value><string>2</string></value></member><member><name>actions</name><value><string>Test SIM with PIN inserted, SS is set to emulate a 2G/3G cell</string></value></member><member><name>expected_results</name><value><string>Nothing Special !</string></value></member><member><name>execution_type</name><value><string>1</string></value></member></struct></value><value><struct><member><name>step_number</name><value><string>3</string></value></member><member><name>actions</name><value><string>Configure Network Friendly Mode blabla</string></value></member><member><name>expected_results</name><value><string>OK</string></value></member><member><name>execution_type</name><value><string>1</string></value></member></struct></value><value><struct><member><name>step_number</name><value><string>4</string></value></member><member><name>actions</name><value><string>Configure Network Friendly Mode (maximum number of ...)</string></value></member><member><name>expected_results</name><value><string>Nothing Special !</string></value></member><member><name>execution_type</name><value><string>2</string></value></member></struct></value><value><struct><member><name>step_number</name><value><string>5</string></value></member><member><name>actions</name><value><string>Trigger PS detach from the DUT</string></value></member><member><name>expected_results</name><value><string>OK</string></value></member><member><name>execution_type</name><value><string>1</string></value></member></struct></value></data></array></value></member></struct></value></param></params></methodCall>

<methodResponse>
   <params>
      <param>
         <value>
            <struct>
               <member><name>status_ok</name><value><boolean>1</boolean></value></member>
               <member><name>msg</name><value><string>ok</string></value></member>
               <member><name>operation</name><value><string>updateTestCase</string></value></member>
            </struct>
         </value>
      </param>
   </params>
</methodResponse>

<!-- No Problem steps has been correctly updated but a project (not the one containing the TC) has been deleted!ç-->

<!-- Now I update TC name AND a step attribute -->
<methodCall><methodName>tl.updateTestCase</methodName><params><param><value><struct><member><name>devKey</name><value><string>b2bdf05f63744524b90483f0ba5634b6</string></value></member><member><name>testcaseexternalid</name><value><string>BUGUTC-1</string></value></member><member><name>version</name><value><int>1</int></value></member><member><name>steps</name><value><array><data><value><struct><member><name>step_number</name><value><string>1</string></value></member><member><name>actions</name><value><string>Test SIM with PIN inserted, SS is set to emulate a 2G/3G cell</string></value></member><member><name>expected_results</name><value><string></string></value></member><member><name>execution_type</name><value><string>1</string></value></member></struct></value><value><struct><member><name>step_number</name><value><string>2</string></value></member><member><name>actions</name><value><string>Test SIM with PIN inserted, SS is set to emulate a 2G/3G cell</string></value></member><member><name>expected_results</name><value><string>KO</string></value></member><member><name>execution_type</name><value><string>1</string></value></member></struct></value><value><struct><member><name>step_number</name><value><string>3</string></value></member><member><name>actions</name><value><string>Configure Network Friendly Mode blabla</string></value></member><member><name>expected_results</name><value><string>OK</string></value></member><member><name>execution_type</name><value><string>1</string></value></member></struct></value><value><struct><member><name>step_number</name><value><string>4</string></value></member><member><name>actions</name><value><string>Configure Network Friendly Mode (maximum number of ...)</string></value></member><member><name>expected_results</name><value><string>Nothing Special !</string></value></member><member><name>execution_type</name><value><string>2</string></value></member></struct></value><value><struct><member><name>step_number</name><value><string>5</string></value></member><member><name>actions</name><value><string>Trigger PS detach from the DUT</string></value></member><member><name>expected_results</name><value><string>OK</string></value></member><member><name>execution_type</name><value><string>1</string></value></member></struct></value></data></array></value></member></struct></value></param></params></methodCall>

<methodResponse>
   <params>
      <param>
         <value>
            <struct>
               <member><name>status_ok</name><value><boolean>1</boolean></value></member>
               <member><name>msg</name><value><string>ok</string></value></member>
               <member><name>operation</name><value><string>updateTestCase</string></value></member>
            </struct>
         </value>
      </param>
   </params>
</methodResponse>

<!--  It works and the project has not been deleted.
I wonder the behavior happens if it exists a Project with project id = 1-->
jaracic
TestLink user
 
Posts: 4
Joined: Thu Jul 30, 2015 6:29 pm

Re: updateTestCase delete whole project when steps in parame

Postby jaracic » Tue Aug 04, 2015 2:47 pm

I confirm, the project deletion occurs only if a project with id=1 exists, and that project is deleted....
Does someone could confirm that behavior before I create a tracker in Mantis ?
kind regards.
Joseph.
jaracic
TestLink user
 
Posts: 4
Joined: Thu Jul 30, 2015 6:29 pm

Re: updateTestCase delete whole project when steps in parame

Postby fman » Tue Aug 04, 2015 6:43 pm

Some improvements to code (better checks on node type) has been added on several methods, and one of them is delete_steps_by_id()

https://github.com/TestLinkOpenSourceTR ... 2595c59e9b

that's why I need that you get latest code and RETEST before creating any issue on Mantis, because first request to reporter always is: Please get latest code, do fresh install, retest and provide feedback
fman
Member of TestLink Community
 
Posts: 3024
Joined: Tue Nov 15, 2005 7:19 am


Return to XML-RPC API



Who is online

Users browsing this forum: No registered users and 3 guests