Creating a Customized method for a Control
Posted: 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 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.