Closed harihara6 closed 9 years ago
Now this is giving stable results
IWebDriver driver = Host.Instance.Application.Browser;
WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(3));
wait.Until(t => t.FindElement(By.Id("delete")).GetAttribute("class")=="modal fade in");
wait until the class changes to modal fade in from modal fade Any better ideas are appreciated.
I am trying to test a page where a bootstrap modal is show asking for confirmation to delete. Modal will have a fade animation effect which makes the test fail saying the element is not visible.I have tried few things,
1 Thread.Sleep() - Its working until the button click on modal. But the next line (code given below) is not returning the CCPage. It takes some time after delete for the page to load. But it is not waiting for the given 10 secs to allow the page load.
return this.Navigate.To(By.XPath("id('delete')/div/div/div[3]/button"), TimeSpan.FromSeconds(10));
2 Code from somewhere over internet
3 Some other approach
But these 2 approaches are not working. And am not sure if i am initiating driver correctly. Please help out.