Page 1 of 1

Passing object from object repository to user code methods

Posted: Mon Jul 29, 2019 4:58 pm
by hanen.fredj
Hello,
I need to create a new method to set text in a text field and a second one to select an item from a list.
For both methods I have to set the object(text field or the list) and the value (to type or to select) as parameters.
Could you tell me how is it possible to pass the objects from the object repository to the user code please?
Thank you.

Re: Passing object from object repository to user code methods

Posted: Tue Jul 30, 2019 8:37 pm
by Vega
You can right click -> view code to see how Ranorex does it as your basis. I just made a click action on the explorer and then right click -> view code:

Code: Select all

 public void Mouse_Click_Explorer(RepoItemInfo menubarInfo)
        {
            Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'menubarInfo' at Center.", menubarInfo);
            menubarInfo.FindAdapter<MenuBar>().Click();
        }
You can also make a reference to the repository:
farm1.png
Hope this helps