Merge Action to Usercode adds Adapter

Ask general questions here.
rajeswari
Posts: 14
Joined: Mon Mar 14, 2016 4:26 pm

Merge Action to Usercode adds Adapter

Post by rajeswari » Thu Jan 19, 2017 4:26 pm

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.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Merge Action to Usercode adds Adapter

Post by krstcs » Thu Jan 19, 2017 5:20 pm

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
Shortcuts usually aren't...

rajeswari
Posts: 14
Joined: Mon Mar 14, 2016 4:26 pm

Re: Merge Action to Usercode adds Adapter

Post by rajeswari » Fri Jan 20, 2017 10:35 am

:| Yes i checked the link, Thanks for your reply.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3933
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Merge Action to Usercode adds Adapter

Post by odklizec » Fri Jan 20, 2017 10:44 am

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.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

David Zita
Posts: 14
Joined: Thu Mar 31, 2016 1:20 pm

Re: Merge Action to Usercode adds Adapter

Post by David Zita » Fri Jan 20, 2017 1:39 pm

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.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Merge Action to Usercode adds Adapter

Post by krstcs » Fri Jan 20, 2017 4:54 pm

David, you are correct, I was looking at the change to the API, which was added in 6.1.0. My mistake.
Shortcuts usually aren't...

rajeswari
Posts: 14
Joined: Mon Mar 14, 2016 4:26 pm

Re: Merge Action to Usercode adds Adapter

Post by rajeswari » Mon Jan 23, 2017 12:49 pm

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.