c# - Recognition issue for window in different thread (tafx) -


we trying use testing automation fx automating basic workflow , testing in our application. record function otherwise works flawlessly except in 1 specific case windows form in question started different thread.

i noticed map generates indistinguishable parent form in our application. form of type uiwindow , following designer code same.

            this.uiwindow2.comment = null;             this.uiwindow2.matchedindex = 0;             this.uiwindow2.msaaname = null;             this.uiwindow2.msaarole = system.windows.forms.accessiblerole.client;             this.uiwindow2.name = "uiwindow2";             this.uiwindow2.objectimage = ((system.drawing.bitmap)(resources.getobject("uiwindow2.objectimage")));             this.uiwindow2.ownedwindow = true;             this.uiwindow2.parent = this.application;             this.uiwindow2.uiobjecttype = testautomationfx.ui.uiobjecttypes.window;             this.uiwindow2.usecoordinatesonclick = true;             this.uiwindow2.windowclass = ""; 

since don't have parent window our form, logical conclusion come windows creating wrapper around form when started different thread.

what when tafx runs test cases, fails find uiwindow2 or hooks onto other window failing test. totally random. know if there possible solution situation?

we spawning window in different thread using following code snippet

    private void launchblottformnewonnewthread()     {         form blottform = new blottform();         application.enablevisualstyles();         application.setcompatibletextrenderingdefault(false);         application.run(blotterform);     }      private void startblott()     {         thread blottthread = new thread(new threadstart(launchblottformnewonnewthread));         blottthread.setapartmentstate(apartmentstate.sta);         blottthread.name = "blottthread";         blottthread.isbackground = true;         blottthread.start();     } 


Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -