Page 1 of 1

Merge Action to Usercode adds Adapter

Posted: Thu Jan 19, 2017 4:26 pm
by rajeswari
Hi, I have been using Ranorex 6.0 until now, and i used to record actions and merge actions to usercode.

But after the upgrade of 6.2 the merge actions to user code is adding adapters into arguments to the usercode and its different. is there any setting to return this to normal repo.frm.element type.

Ranorex 6.2

Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'titlebarInfo' at Center.", titlebarInfo);
FindAdapter<TitleBar>().Click();
Report.Log(ReportLevel.Info, "Mouse", "Mouse Left DoubleClick item 'listitemInfo' at Center.", listitemInfo);
FindAdapter<ListItem>().DoubleClick();

Ranorex 6.0

Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'UC_FrmMainSetup.Huntgrp_List.First_HuntGrp' at Center.", repo.UC_FrmMainSetup.Huntgrp_List.First_HuntGrpInfo, new RecordItemIndex(2));
repo.UC_FrmMainSetup.Huntgrp_List.First_HuntGrp.Click();

Please help. i would like the merge usercode method to be as in 6.0 version.

Re: Merge Action to Usercode adds Adapter

Posted: Thu Jan 19, 2017 5:20 pm
by krstcs
This was changed in 6.1.0 and is listed as a breaking change to 6.0.X. There is no way to change it back. You will need to rework your tests to conform to the new standard.

Please read the release notes each time you upgrade as they usually explain these types of breaking changes in detail. For instance, they explain this change here: http://www.ranorex.com/release-notes.html#c14023

Re: Merge Action to Usercode adds Adapter

Posted: Fri Jan 20, 2017 10:35 am
by rajeswari
:| Yes i checked the link, Thanks for your reply.

Re: Merge Action to Usercode adds Adapter

Posted: Fri Jan 20, 2017 10:44 am
by odklizec
Hi,

Could you please explain what exactly is your problem regarding this change? This could help Ranorex developers (and the rest of us here) to understand the source of your problem.

Re: Merge Action to Usercode adds Adapter

Posted: Fri Jan 20, 2017 1:39 pm
by David Zita
I have the same problem. First, I need to correct some facts.
The issue/feature I am talking about was introduced in 6.2 (see release notes, 'Record table actions converted to user code provide RepositoryItemInfo as method argument'). The feature as it is is great, but not always it is needed to have the user code method parameterized. For instance, I often record some actions, then I need to execute them only if some condition is met, so I convert (merge) the actions to user code and add the if, else etc. Since 6.2, the code is less selfexplaining since there are lot of info items, FindAdapter methods, but you don't see on what repository items the actions are called.
Yes, there is a workaround, instead of merging actions into user code, click View code on the action, copy the code , create custom method, paste the code, use it. But it's not that handy as it was before 6.2. So if there was an option the use old/new way, that would be great.

Re: Merge Action to Usercode adds Adapter

Posted: Fri Jan 20, 2017 4:54 pm
by krstcs
David, you are correct, I was looking at the change to the API, which was added in 6.1.0. My mistake.

Re: Merge Action to Usercode adds Adapter

Posted: Mon Jan 23, 2017 12:49 pm
by rajeswari
Hi David, Thanks for filling in. it was due to the arguments passed, i had the difficulty, hope there is a choice in future to convert to usercode with/ without parameters.
And Yes im following the same workaroud, copied code from module.cs and adding to usercode ( module.usercode.cs) . Thanks.