public void Schedule(SeleniumTask task) { if (!_isRunning) { _logger.LogError("Scheduler not started"); return; } _tasks.Add(task, _token); }
public async Task ExecuteAsync(SeleniumTask task) { try { await task.ExecuteAsync(_driver); } catch (Exception ex) { _logger.LogError($"Encountered an error while trying to execute a task.{Environment.NewLine}Error message: {ex.Message}{Environment.NewLine}Stack trace: {ex.StackTrace}"); } }