private static async Task Initialise()
        {
            try
            {
                LogEvent(LoggingLevel.Info, $"Starting...");

                await BrowserPages.InitialiseBrowser();

#if PRELOAD || RELEASE
                await BrowserPages.PreLoadPages();

                while (true)
                {
                    await InitialiseQueueAsync();

                    InitialisePlugin();

                    await _plugin.Execute();
                }
#else
                await BrowserPages.LoadCurrentPage(Sites.Google);

                await _plugin.Execute();
#endif
            }
            catch (Exception ex)
            {
                LogEvent(LoggingLevel.Exception, $"Global exception was caught.", ex);
                _plugin?.DisposePlugin();
            }

            Console.ReadLine();
        }
Exemplo n.º 2
0
        public async Task DisposePlugin()
        {
            LogEvent(LoggingLevel.Info, $"Disposing Driver.");

            await _page.CloseAsync();

            _page.Dispose();

            await BrowserPages.ResetPage(_transactionMessage.Site);
        }