/// <summary> /// Click UIItem with an offset on the X and Y axis (this uses cursor) /// </summary> /// <param name="offsetX">The amount of pixels to offset the UIItem's X coordinate (horizontal)</param> /// <param name="offsetY">The amount of pixels to offset the UIItem's Y coordinate (vertical)</param> public void Click(int offsetX, int offsetY) { ReportActionValue("Click", string.Format("offsetX = {0}, offsetY = {1}", offsetX, offsetY)); CaptureImage(); var coordinateX = Convert.ToInt32(UIItem.Location.X) + offsetX; var coordinateY = Convert.ToInt32(UIItem.Location.Y) + offsetY; QAMouse.Click(new Point(coordinateX, coordinateY)); }
/// <summary> /// Select a row from the table /// </summary> /// <param name="zeroBasedRowIndex">Index of row to be selected</param> public void SelectFirstRow(int zeroBasedRowIndex) { var searchCriteria = SearchCriteria.ByAutomationId(string.Format("Row_{0}", zeroBasedRowIndex)); var row = QATableRow.Get(searchCriteria, string.Empty, UIItem, 5000); var firstCell = QAUIItem.Get(SearchCriteria.Indexed(0), string.Empty, row.UIItem, 5000); var location = firstCell.Location; location.X -= 2; location.Y += 2; QAMouse.Click(new Point((int)location.X, (int)location.Y)); }