Page 1 of 1

Removing arguments in Argument Editor for recording module

Posted: Fri Dec 04, 2015 12:40 am
by log
Hi all,

We have noticed some behaviour in the Argument Editor for a recording module that we believe to be a bug.

This has been replicated on two different versions of Ranorex Studio, 5.4.0.24580 and 5.4.0.24580, both of which are using .NET runtime version 4.0.30319.18408.

Consider the following User Code method in a recording module (which is a simple example):

Code: Select all

public void MyUserCodeMethod(string firstArgument, string secondArgument, string thirdArgument, string fourthArgument)
        {
        	string one = firstArgument;
        	string two = secondArgument;
        	string three = thirdArgument;
        	string four = fourthArgument;
        }

1. With the recording module open, click on the [Args...] button for the User Code method.
2. In the Argument Editor dialog that opens, select the "firstArgument" in the Arguments list
ArgumentEditor-SelectedArgument.png
3. Click the [Remove] button.
4. Click the [OK] button.
5. Open the User Code method again.

Expected results:
Only changes have been made to the signature of the MyUserCodeMethod and the firstArgument parameter has been removed. The body of the method should remain the same and be untouched.

Actual results:
Usages of all of the parameters that follow the removed parameter have been updated as well. They have all shifted to the next argument.

Code: Select all

 public void MyUserCodeMethod(string secondArgument, string thirdArgument, string fourthArgument)
        {
        	string one = secondArgument;
        	string two = thirdArgument;
        	string three = fourthArgument;
        	string four = fourthArgument;
        }
The fact that the body of the User Code method is changed by the removal of an input parameter using the Argument Editor can cause much confusion and logical errors that may or may not result in compilation errors. If there are no compilation errors, there will be runtime errors which will need to be diagnosed by the user.

When an input parameter is removed using the Argument Editor, the body of the User Code method should not be touched/refactored and it should be up to the user to fix any compilation errors for code which still references the removed input parameter.

Thanks,
Gabriel

Re: Removing arguments in Argument Editor for recording module

Posted: Mon Dec 07, 2015 2:23 pm
by Support Team
Hello Gabriel,

Thank you for reporting this issue. This is not the expected behavoir, indeed.

I will add an entry to our internal bug-tracking system. We try to discuss and fix this issue as soon as possible.

Thank you for your cooperation.

Sincerely,
Robert