Control/Form.SubscribeEvent
Posted: Tue Feb 10, 2009 10:12 am
Hello,
at our automated tests we have to fill huge forms (sometimes about 300 controls or more), where every control can (in the case of input-errors) show an error-dialog. So if we always wait for a message-box to appear (or not in normal case) it lasts very long. For this reason we want to make use of "Control.SubscribeEvent".
In my test-scenario i have three steps that have to repeat some hundred times. First, set the form to editmode = edit; second, fill the controls; third, save the data. At the first turn, the delegate is added to the event handlers-list as usual. But at the second (and every further) turn it doesn't work.
Because of i am the programmer and the test-writer in one person, i was able to change one of the events to a custom event-type, so i can look what happen, if "Control.SubscribeEvent" was callen. For the first time the delegate is added to the events handlers-list, as usual. For the second and any further time the events "addhandler"-method isn't called?
Can anyone explain my mistake? If i try this with a (ranorex) form-object, the delegate is never added to the events handlers-list...
Ah, it's Ranorex.net 1.5 and i am automating controls that where derived from Infragistics-Net-Controls. The forms are directly derived from Windows-Forms...
Regards
Jürgen
at our automated tests we have to fill huge forms (sometimes about 300 controls or more), where every control can (in the case of input-errors) show an error-dialog. So if we always wait for a message-box to appear (or not in normal case) it lasts very long. For this reason we want to make use of "Control.SubscribeEvent".
In my test-scenario i have three steps that have to repeat some hundred times. First, set the form to editmode = edit; second, fill the controls; third, save the data. At the first turn, the delegate is added to the event handlers-list as usual. But at the second (and every further) turn it doesn't work.
Because of i am the programmer and the test-writer in one person, i was able to change one of the events to a custom event-type, so i can look what happen, if "Control.SubscribeEvent" was callen. For the first time the delegate is added to the events handlers-list, as usual. For the second and any further time the events "addhandler"-method isn't called?
Can anyone explain my mistake? If i try this with a (ranorex) form-object, the delegate is never added to the events handlers-list...
Ah, it's Ranorex.net 1.5 and i am automating controls that where derived from Infragistics-Net-Controls. The forms are directly derived from Windows-Forms...
Regards
Jürgen