Page 1 of 1

FindAdapter Definition

Posted: Tue Jul 18, 2017 4:06 pm
by kdreiling
Can someone please explain when converting from generated code to custom user code, this FindAdapter code gets created? I don't understand the FindAdapter logic and why the generated code does not convert into the User Code. Am I possibly missing a Ranorex option that needs to be set?

See Example:

Report.Log(ReportLevel.Info, "Keyboard", "Key sequence from variable '$varEndDate' with focus
on 'comboboxInfo'.", repo.AuthorizationForm.TreatmentLine.EndDateccbInfo);

AuthEndDate.FindAdapter<ComboBox>().PressKeys(varEndDate);

Re: FindAdapter Definition

Posted: Wed Jul 19, 2017 1:19 pm
by odklizec
Hi,

This has been changed in Ranorex 6.2. Basically, if the action is converted to User Code, repo item used in the action is converted to repoiteminfo argument. And because PressKeys, Click and many other methods requires an adapter, Ranorex automatically converts the repoiteminfo to adapter, using FindAdapter method. This feature was discussed also here:
https://www.ranorex.com/forum/merge-act ... tml#p41899

There is no option to change this behavior. If you don't like this automatic behavior, you only hope is to create the custom method manually (without repoiteminfo argument) and copy the action code from recording.cs file.