FlaUI/FlaUInspect

Handle some runtime exceptions which appear during interaction with Telerik WPF based apps

aurax opened this issue · 2 comments

aurax commented

Two exceptions were observed:

  1. \src\FlaUInspect\Core\HoverMode.cs, line 43:
    var hoveredElement = _automation.FromPoint(screenPos);
System.IO.FileNotFoundException
  HResult=0x80070002
  Message=The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
  1. \src\FlaUInspect\ViewModels\ElementViewModel.cs, line 298:
    var foreColor = (int)pattern.DocumentRange.GetAttributeValue(TextAttributes.ForegroundColor);
System.InvalidCastException
  HResult=0x80004002
  Message=Specified cast is not valid.
  Source=FlaUInspect
  StackTrace:
   at FlaUInspect.ViewModels.ElementViewModel.LoadDetails() in <FlaUInspect>\src\FlaUInspect\ViewModels\ElementViewModel.cs:line 298
aurax commented

I've made a fix for it.

I now even made a better handling for the textpattern details.