I am using Ranorex with Selenium Endpoint for technical reasons (Cannot call the Ranorex Agent remotely).
I need to reset the content of each Control before introduce business Data, so i coded a Utility Method
Code: Select all
public static void ClearText(Ranorex.Adapter a)
{
Report.Log(ReportLevel.Info,"Content Reset " + a);
a.PressKeys("{END}{SHIFT DOWN}{HOME}{SHIFT UP}{DELETE}");
Report.Log(ReportLevel.Info,"Reset OK " + a);
}
Code: Select all
a.Click();
Keyboard.Press(System.Windows.Forms.Keys.End, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true);
Keyboard.Press(System.Windows.Forms.Keys.Home | System.Windows.Forms.Keys.Shift | System.Windows.Forms.Keys.Control, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true);
Keyboard.Press(System.Windows.Forms.Keys.Delete, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true);
Any idea please?
Best regards