/// <summary> /// Salir del navegador /// </summary> private static void SalirNavegador() { try { PropiedadDriver.GetDriver.Quit(); PropiedadDriver.Dispose(); } catch (Exception) { throw new Exception("No se ha podido cerrar el navegador"); } }
/// <summary> /// Esperar y realizar clic en elemento /// </summary> /// <param name="element">Elemento</param> public void WaitAndClickElement(IWebElement element) { try { PropiedadDriver.GetDriverWait((int)TimeOut.medium).Until(ExpectedConditions.ElementToBeClickable(element)); element.Click(); } catch (Exception) { throw new Exception("Se ha excedido tiempo de espera y no es posible realizar clic en elemento"); } }