Removing arguments in Argument Editor for recording module

Bug reports.
log
Certified Professional
Certified Professional
Posts: 14
Joined: Tue Mar 24, 2015 6:28 am
Location: Sydney, Australia

Removing arguments in Argument Editor for recording module

Post by log » Fri Dec 04, 2015 12:40 am

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
ArgumentEditor-SelectedArgument.png (16.26 KiB) Viewed 704 times
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

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Removing arguments in Argument Editor for recording module

Post by Support Team » Mon Dec 07, 2015 2:23 pm

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
.
Image