I noticed a strange behavior in one of our test reports regarding the validation of a System.Windows.Forms.TextBox-element.
In a test-case we want to validate the displayed text of a TextBox-control after typing it in the control:
const int verzoegerungInMillisekunden = 100; Report.Info("Suche", string.Format("Eingabe der Zeichenkette \"{0}\" in das Suchwert-Eingabefeld.", suchWertText)); suchWertEingabe.PressKeys(suchWertText); Report.Info("Suche", string.Format("Test wird um {0} Millisekunden verzögert", verzoegerungInMillisekunden)); Delay.Milliseconds(verzoegerungInMillisekunden); Validate.AreEqual(suchWertEingabe.TextValue, suchWertText, "Validierung des eingegebenen Textes - Soll: {1}, Ist: {0}");To explain: Ranorex should press the key-sequence in the control, then wait for a short duration (when it first appears I thought of a timing problem) and finally validate the text displayed in the control.
suchWertEingabe: Repository item of the control suchWertText: string to type, in this case "Taxiruf BC"And the result was: I also attached the screenshots taken by Ranorex because of the false validation, where you can see that the text in the control is "Taxiruf BC" and not "Taxiruf".
How can we avoid this false validation failure?
Regards,
Thomas.