{"record":{"id":"c663a8059d82e469","repo":"dotnet/wpf","slug":"sr-logicalelementnoclickablepoint","errorCode":null,"errorMessage":"SR.LogicalElementNoClickablePoint","messagePattern":"SR\\.LogicalElementNoClickablePoint","errorType":"exception","errorClass":"NoClickablePointException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/AutomationElement.cs","lineNumber":918,"sourceCode":"            \n            // the providers point is either no good or they did not have one so poke around \n            // trying to find one.\n            if (ClickablePoint.HitTestForClickablePoint( (AutomationElement)this, out pt) )\n                return true;\n            \n            return false;\n        }\n        \n        /// <summary>\n        /// Get a point that can be clicked on.  This throws the NoClickablePointException if there is no clickable point\n        /// </summary>\n        /// <returns>A point that can be used by a client to click on this LogicalElement</returns>\n        /// <exception cref=\"NoClickablePointException\">If there is not clickable point for this element</exception>\n        public Point GetClickablePoint()\n        {\n            Point pt;\n            if ( !TryGetClickablePoint( out pt ) )\n                throw new NoClickablePointException(SR.LogicalElementNoClickablePoint);\n\n            return pt;\n        }\n        #endregion Public Methods\n\n\n        //------------------------------------------------------\n        //\n        //  Public Properties\n        //\n        //------------------------------------------------------\n \n        #region Public Properties\n\n        /// <summary>\n        /// Get root element for current desktop\n        /// </summary>\n        /// <returns>root element for current desktop</returns>","sourceCodeStart":900,"sourceCodeEnd":936,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/AutomationElement.cs#L900-L936","documentation":"GetClickablePoint returns a screen point that can be clicked, but UIA providers may not expose any clickable point. When TryGetClickablePoint returns false, the wrapper throws NoClickablePointException with SR.LogicalElementNoClickablePoint, as documented by the method's exception clause.","triggerScenarios":"Calling GetClickablePoint() on an element whose provider does not supply the ClickablePointProperty value, or whose clickable point is off-screen/obscured so no valid point exists.","commonSituations":"Mouse-based UI test automation on elements like menus, non-rectangular or virtualized items; elements scrolled outside the viewport; providers that simply omit ClickablePoint.","solutions":["Call TryGetClickablePoint instead and handle the false return","Fall back to BoundingRectangle center when no clickable point exists","Scroll the element into view (ScrollItemPattern) and retry"],"exampleFix":"// before\nPoint pt = element.GetClickablePoint();\n// after\nif (!element.TryGetClickablePoint(out Point pt))\n    pt = element.BoundingRectangle.Center();","handlingStrategy":"fallback","validationCode":"bool hasClickable = element.TryGetClickablePoint(out _);\nRect bounds = element.BoundingRectangle;\nbool onScreen = bounds.IntersectsWith(SystemInformation.VirtualScreen);","typeGuard":"bool TryGetClickPoint(AutomationElement e, out Point pt) => e.TryGetClickablePoint(out pt);","tryCatchPattern":"try { pt = element.GetClickablePoint(); }\ncatch (NoClickablePointException) { pt = CenterOf(element.BoundingRectangle); }","preventionTips":["Use TryGetClickablePoint as the primary API","Scroll elements into view with ScrollItemPattern before requesting points","Fall back to BoundingRectangle center for providers without ClickablePoint"],"tags":["uiautomation","wpf","clickable-point","no-clickable-point-exception"],"backgroundTag":"resource-not-found","analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-21T21:30:21.729Z"}