FlaUI / FlaUInspect

Inspect tool to inspect UIs from an automation perspective
MIT License
410 stars 97 forks source link

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

Closed aurax closed 3 years ago

aurax commented 3 years ago

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)

2) \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 3 years ago

I've made a fix for it.

Roemer commented 3 years ago

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