2gis/Winium.Cruciatus

Clicking on a button that closes the window may trigger an exception

Opened this issue · 0 comments

Repro using the standard "FileOpenDialog":

  1. set the content of the address toolbar and filename combos to point to an existing file
  2. trigger a click on the "Open" button

Chances are the dialog closes fast enough for the Logger.Info(..._ calls in TryClick... methods in CruciatusCommands.cs to find a now-invalid Element, which will cause an exception while trying to format the message. In my case, it happened more often than not.

Suggestion: format the message in advance into a local variable before performing the click action, use the formatted message with Logger.Info after performing the click action.