Tuesday 15 February 2011

c# - UI Automation with White issue finding childs -


For some reason I get a runtime error from white.

Error displayed:

  White.Core.Mappings.ControlDictionaryException: WinCraft on White: ControlType = Could not get testControl and FrameworkId for window . Core.Mappings.ControlDictionary.GetTestControlType (ControlType controlType, String frameWorkId, Boolean isNativeControl) at White.Core.Mappings White.Core.Mappings.ControlDictionary.GetTestType (string classname, control type control type, string framework id, string name, boolean isNativeControl ) On. On White ControlType (AutomationElement AutationElement) White Core.finter On White in Datimized Itamfactree.com (Autumnment Element Automation Element, Action Listener Action Listener) Corner. Factor DesignMap ItamFactory Create (Automation Element Element, Action Lustner Action Listener, Type Custom Eatam Type) White. Core.factory in primary White on Search Certificate Search Certifier, Action Last Action Action Listener) Corner. Utilities Container. Non-Cached Container ITEMFactria Find (Search Certificate Search Certifier) ​​in White Corner. Utilities Container.ContainerItamFactRterGet (Search Certifiers Search Syritiya, ExxonistInitem Action Listener) in White. Cores. Null Windows. Gate (container etam factory container item factory, search certifiers, executive action listener) White. At Core.UITs Container.CurrentContainerItemFactory.Find (Expand SearchCriteria searchCriteria, windowSession windowSession) on White.Core.UIItems.UIItemContainer.Get (SearchCriteria searchCriteria) --- Internal Exception Stack Trace Ends - SearchCriteria at White.Core.UIItems.UIItemContainer.Get ID1 ICOWrapper.Form1.wasUserLoggedIn (string ICOWrapper.Form1.button2_Click on System.Windows.Forms.Control.OnClick, string ID 2) System.Windows.Forms.Button (object searchCriteria the sender, EventArgs e)) (EventArgs e) In. OnClick (EventErguesE) on the system.indo.form. button. OnMouseUpdate (MouseIventArguesMevent) system Windows .form. Control Mamayuuyuesuuupi (Message and amp; m) (message System.Windows.Forms.Button.WndProc & amp; m) (message System.Windows.Forms.ButtonBase.WndProc & amp; M, MouseButtons button, Int32 System. WindowskFormskControlkWndProc (clicks on the message & amp); m) in System.Windows.Forms.NativeWindow.Callback (IntPtr hWnd; m) (message System.Windows.Forms.Control.ControlNativeWindow.WndProc & amp; System.Windows.Forms.Control.ControlNativeWindow.OnMessage (message & the amp m), Intpit Wapram, Intpitr Liprm)   

I'm trying to navigate the current The structure is low:

The main Dow & gt; Panel-> Window

and I am using the following method in C #

  The public boolean was User login (string id 1, string id 2) {Thread.Sleep (500); Var mdiClient = window.MdiChild (SearchCriteria.ByControlType (ControlType.Pane). Invention ID (ID1)); Thread.Sleep (500); Var selectPatient = (window) mdiClient.Get (SearchCriteria.ByControlType (ControlType.Window). Indexed ID (id2)); Thread.Sleep (500); Select Refund Patient! = Null? right wrong; }   

and follow the call as a method:

  was a boolean was found = user-in-one ("40 9 60 "," 40 9 61 ");   

UIspy used to identify ControlType and AutomationID items:

  AutomationId: 40960 ControlType: ControlType.Pane name: HelpText : bounding rectangle: 8,78,900,581 class name: MDIClient ISOffScreen: wrong framework ID: Win32 ProcessId: 5964 automation ID: 40961 control type: ControlType.Window name: Home Helptekst: rectangular bounding: 8,59,900,600 Classname: ClaWin01000000H_2 IsOffScreen: wrong Fremvrkaidi: Win32 ProcessId: 5964    

I recommend that TestStack.White The old whats of the ringing Body library

The problem is that you do not want to use . For MDI applications you should use the MdiChild () , if this is a modal window, then .odol () on Go to the parent window or back to the application then use the window to get the window

hopefully < / Html>

No comments:

Post a Comment