add error handler for actiononelement util
This commit is contained in:
parent
dc0c2ca8ad
commit
74d38a5132
|
|
@ -19,6 +19,8 @@ public class UtilWebActionOnElementFn : IFunctionCallback
|
|||
{
|
||||
var locatorArgs = JsonSerializer.Deserialize<ElementLocatingArgs>(message.FunctionArgs);
|
||||
var actionArgs = JsonSerializer.Deserialize<ElementActionArgs>(message.FunctionArgs);
|
||||
try
|
||||
{
|
||||
if (actionArgs.Action == BroswerActionEnum.InputText)
|
||||
{
|
||||
// Replace variable in input text
|
||||
|
|
@ -57,6 +59,12 @@ public class UtilWebActionOnElementFn : IFunctionCallback
|
|||
|
||||
message.Data = await browser.ScreenshotAsync(msg, path);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
message.Data = $"{actionArgs.Action} execution failed.";
|
||||
_logger.LogError($"UtilWebActionOnElementFn exception: {ex.Message}. StackTrace: {ex.StackTrace}");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue