/// <summary> /// Function to select options read from getproductdetails function for configuring product. /// </summary> /// <param name="productDetails"></param> /// <returns></returns> public QuotePage SelectProductOptions(List <ProductDetail> productDetails) { WebDriverWait customWait = new WebDriverWait(driver, TimeSpan.FromSeconds(30)); customWait.Until(ExpectedConditions.ElementIsVisible(By.Id("Mounting"))); foreach (ProductDetail product in productDetails) { driver.FindElement(By.Id(product.OptionTypeId)).EnterText(product.Option); driver.FindElement(By.Id(product.OptionTypeId)).SendKeys(Keys.Enter); _logger.Info($": Successfully entered Option {product.Option} for Option Type {product.OptionTypeId}"); try { WebDriverWait customWait2 = new WebDriverWait(driver, TimeSpan.FromSeconds(1)); customWait2.Until(ExpectedConditions.ElementIsVisible(By.Id("idBtnOK"))); OkButton.Clickme(driver); } catch (Exception e) { Console.WriteLine(e.StackTrace); } Thread.Sleep(500); } return(this); }
/// <summary> /// Warning popup Ok button click. /// </summary> /// <returns></returns> public QuotePage OkOnErrorMessage() { WaitHelpers.WaitForElementToBecomeVisibleWithinTimeout(driver, OkButton, 60); OkButton.Clickme(driver); return(this); }