public void Listener(By by) { try { Task.Factory.StartNew(() => { _logger.LogInfo(string.Format("Listener running, looking for element(s) [{0}] for every [{1}] milliseconds", by, intervalInmilliseconds)); while (_driver != null) { try { foreach (var element in _findManager.Finds(by)) { element.Click(); } } catch (Exception) { //ignore Exception Thread.Sleep(intervalInmilliseconds); } } }); } catch (Exception e) { _logger.LogError(e.ToString()); throw; } }
protected List <IWebElement> Finds(By by) { return(_findManager.Finds(by)); }