Creating a Customized method for a Control

Ask general questions here.
ankurm.245
Posts: 9
Joined: Fri Dec 14, 2018 5:26 am

Creating a Customized method for a Control

Post by ankurm.245 » Thu Jan 03, 2019 4:01 am

Hello,

I have a situation where I need to perform multiple actions on a control every time I interact with that type of control.

For Ex:
txt_someTextBox.Click();
txt_someTextBox.PressKey("{ControlKey down}{AKey}{ControlKey up}");
txt_someTextBox.PressKey("Some Text");

Can I do something like

txt_someTextBox.PressKeyCustom("Some Text");

Where PressKeyCustom would perform below internally:
Click
Ctrl + A
Press Key.

If above is possible, how that can be done as otherwise I would have to write the code every time I use the specific control.
I=AM!

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

Re: Creating a Customized method for a Control

Post by odklizec » Mon Jan 07, 2019 8:43 am

Hi,

This blog post describes exactly what you want...
https://www.ranorex.com/blog/custom-smart-actions/
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

ankurm.245
Posts: 9
Joined: Fri Dec 14, 2018 5:26 am

Re: Creating a Customized method for a Control

Post by ankurm.245 » Mon Jan 07, 2019 9:01 am

Thanks a lot.
I=AM!