Please see the attachments (.rxsnp for AUT snapshot and .jpg for error snapshot).
System description:
- Windows 7
- 32 bit OS
- Ranorex version 4.1.5.17134
Such a behaviour is not seen otherwise (without Ranorex).
Please suggest a solution to avoid this situation.
Last successful step was executed in this function:
// private Ranorex.Text FindLabelForParameter(string paramName, bool throwOnMissing = true) { var candidates = repo.FormMAP120.MDI_Form.FeatureScrollViewer.Find<Ranorex.Text>(".//text").ToList(); var orderedCandidates = candidates.OrderBy(c => StringUtilities.LabelCompare(c.TextValue, paramName)); var best = orderedCandidates.FirstOrDefault(); int bestDistance; if (best == null || !StringUtilities.IsTextCloseEnough(best.TextValue, paramName, out bestDistance)) { if (throwOnMissing) { Report.Snapshot(repo.FormMAP120.MDI_Form.FeatureScrollViewer); Report.Failure("dMAP120", "Could not find label '" + paramName + "'"); throw new RanorexException("Could not find label '" + paramName + "'"); } else { return null; } } if (bestDistance == 0) Report.Info("dMAP120", "Selected label '" + best.TextValue + "' for parameter '" + paramName + "' (exact match)"); else Report.Info("dMAP120", "Selected label '" + best.TextValue + "' for parameter '" + paramName + "' (fuzzy match, distance " + bestDistance.ToString() + ")"); return best; }Error was reported in the function:
// private object FindControlForParamName(string paramName, bool enabledOnly = true, bool throwOnMissing = true) { paramName = ReplaceVariables(paramName); string[] parts = paramName.Split('|'); // Check if there is a match for the automationID. foreach (string part in parts) { object control = FindControlForID(part.Trim(), enabledOnly); if (control != null) return control; } // Check if there is a match for label text foreach (string part in parts) { Ranorex.Text label = FindLabelForParameter(part.Trim(), throwOnMissing); if (label != null) { object control = FindControlForLabel(label, enabledOnly); if (control != null) return control; } } if (throwOnMissing) { Report.Snapshot(repo.FormMAP120.MDI_Form.FeatureScrollViewer); Report.Failure("FindControlForParamName", "Could not find control for parameter '" + paramName + "'"); throw new RanorexException("Could not find control for parameter '" + paramName + "'"); } else { return null; } }