public static void SetText(this Ranorex.Unknown container, string text) { if (Functions.GoodData(text)) { container.PressKeys(text); } }
public static void MoveDown(this Ranorex.Unknown container, int moveNum) { for (int i = 0; i < moveNum; i++) { container.PressKeys("{Down}"); } }
public static void MoveLeft(this Ranorex.Unknown container, int moveNum) { for (int i = 0; i < moveNum; i++) { container.PressKeys("{Shift down}{Tab}{Shift up}"); } }
public static void MoveToField(this Ranorex.Unknown container, int rowNum, int colNum) { container.SetToLine(rowNum); for (int i = 0; i < colNum; i++) { container.PressKeys("{Tab}"); } }
public static void SetToLine(this Ranorex.Unknown container, int rowNumber) { container.ClickFirstCell(); for (int i = 0; i < rowNumber; i++) { container.PressKeys("{Down}"); } }
public override RanorexStepExecutionResponse Execute(Dictionary <string, object> arguments) { RanorexStepExecutionResponse stepResponse = new RanorexStepExecutionResponse(); try { RepoItemInfo repoItemInfo = null; string target = (string)arguments.GetValueOrDefault <string, object>("target"); string sequence = (string)arguments.GetValueOrDefault <string, object>("keySequence"); int duration = Convert.ToInt32(arguments.GetValueOrDefault <string, object>("duration")); int delay = Convert.ToInt32(arguments.GetValueOrDefault <string, object>("delay")); int timeout = Convert.ToInt32(arguments.GetValueOrDefault <string, object>("timeout")); bool retrieveImage = (bool)arguments.GetValueOrDefault <string, object>("retrieveImage"); if (timeout == default(int)) { timeout = 10000; } if (duration == default(int)) { duration = 0; } if (target != default(string)) { repoItemInfo = CreateItemInfo(repo, target, timeout); Ranorex.Unknown adapter = CreateAdapter(repoItemInfo); Report.Log(ReportLevel.Info, "Keyboard", "Key '" + sequence + "' Press with focus on UI Element.", repoItemInfo, new RecordItemIndex(Agent.EXECUTION_INDEX)); adapter.PressKeys(sequence, duration); if (retrieveImage) { stepResponse.image64 = GetImage64(adapter); } } else { Report.Log(ReportLevel.Info, "Keyboard", "Key '" + sequence + "' Press.", new RecordItemIndex(Agent.EXECUTION_INDEX)); Keyboard.Press(sequence, duration); } Delay.Milliseconds(200); stepResponse.success = true; } catch (Exception e) { stepResponse.message = "Ranorex Exception: " + e.Message; stepResponse.success = false; } return(stepResponse); }
public static void MoveDown(this Ranorex.Unknown container) { container.PressKeys("{Down}"); }
public static void MoveLeft(this Ranorex.Unknown container) { container.PressKeys("{Shift down}{Tab}{Shift up}"); }
public static void MoveRight(this Ranorex.Unknown container) { container.PressKeys("{Tab}"); }
public static void Toggle(this Ranorex.Unknown container) { container.PressKeys("{Space}"); }