FindAdapter Definition

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
kdreiling
Posts: 34
Joined: Mon Sep 24, 2012 9:45 pm
Location: Kansas City

FindAdapter Definition

Post by kdreiling » Tue Jul 18, 2017 4:06 pm

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);

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

Re: FindAdapter Definition

Post by odklizec » Wed Jul 19, 2017 1:19 pm

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