- Create new blank solution (New Testsuite/Testcase and Recording are already added to the solution by default.)
- Right Click on Project Name in Prjects Browser Tree and select Add -> New Item -> User code collection
- Open the created User Code Collection (it should be opened automatically after creation)
- Right click inside the Class and select Insert New User Code Method
- In the name dialog give the method a name. Here "SetClipBoardText". Press OK to confirm.
- In the code editor add a string parameter to the method and implementation like this:
Code: Select all
[UserCodeMethod] public static void SetClipBoardText(string textString) { WinForms.Clipboard.SetText(textString); }
- Go to the Recording module, and select Add New Action -> User Code -> Select from Library
and select the method you just created inside the UserCodeCollection - User Code Action is added to the Action View of the Recording Module. (OK)
- Build your solution.
- Solution Builds without any errors or warnings. (OK)
- Open User Code Collection again
- Right Click on your method name and select Rename from context menu
- In Rename Dialog change the Method name to i.e. WriteClipBoardText, press OK to confirm.
- Press Strg+S to save changes and build your solution.
- Error occurs that a method is missing:
Code: Select all
Error - Action #1: Method " System.Void UserCodeRefactoring.UserCodeCollection1.SetClipBoardText(System.String textString) " does not exist. Select a different method or add it to the user code. - C:\RanorexProjects\UserCodeRefactoring\UserCodeRefactoring\Recording1.rxrec:1
- Expand the Recoding and open the Recording1.cs file by double clicking on it.
- Inside the ITestModule.Run() implementation we see the renamed method (OK)
- Go to the Actions view of the Recording module
- The Line with the user Code displays an red exclamation sign for error and we see the old method name in method column (NOK)
- Expected: The method reference is automatically updated also in Actions View.
- Select the action line and press Args.. button
- The arguments dialog for the method is displayed (OK)
- Press OK in Arguments dialog. Arguments Dialog is closed. (OK)
- The Warning sign is no more displayed. User Code Action still displayes the old method name (NOK)
- Double click on the User Code line in Actions View to enter the code editor.
- Viewing the arguments dialog and closing it has seemingly created an empty local method with the old method name (NOK)
- Expected: Viewing arguments dialog for errorneus function doesnt silently "heal it", by creating a local empty method satisfying the signature, which will most probably go unnoticed by the developer
I found some similar 4 year old issue here without solution. May be the bug is just still there