How to keep MaskedEdit expanders from breaking CodedUITests? (Visual studio 2010)

I am trying to run coded user interface tests, but ran into a problem. Whenever a test passes through a text field with a masked editing expander on it, it writes the mask as part of the input, but does not enter this mask when it “inputs” this input during playback. Example: mask " / / ____" for a date. If I enter 02 02 2010, the text field correctly displays 02/02/2010, and the test correctly writes 02/02/2010. However, when the test is executed, it enters 02022010, which does not work and causes the test to stop.

My current workaround is to place a statement that enters the input into the try-catch block, and then manually adds Mouse.Click ([the control that received the attached mask]) calls later in the process. This seems to make the mask "shoot" and everything can go on. However, this is a real nuisance for this, since this particular project makes EXTENSIVE use of masked expanders.

Does anyone know a better way?

+3
source share
1 answer

I wrote a simple extension that processes Dutch dates, this extension can be downloaded from codeplex

0
source

Source: https://habr.com/ru/post/1746466/


All Articles