I am using selenium for a while and have some question about the IWebElement Wait procedure.
We have the Explicit Wait and Implicit I use them and understand the meaning but..
How can I make selenium no wait for element at all?
I tried not to use wait functions but still when I call FindElement or GoToUrl its not always return immediately sometimes still wait for 0 to 60 sec
I noticed that in most of time the wait in FindElement didn't return the element and wait for no reason.
for example: call for element id can take 3 sec and not immediately (lot off calls lot of time...) maybe I am doing something wrong.
the main purpose is to take full control of the program and handle the wait time myself (for better efficiency)
maybe there are better articles to understand selenium architecture of finding elements ? (not the selenium API)
(I am using latest version of selenium 2.48.0)
Code example:
driver = new FirefoxDriver();
js = driver as IJavaScriptExecutor;
driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(0));
driver.Manage().Window.Maximize();
driver.Navigate().GoToUrl("someUrl");
IList<IWebElement> loginFrame = driver.FindElements(By.TagName("iframe"));
driver.SwitchTo().DefaultContent().SwitchTo().Frame(loginFrame[0]);
driver.FindElement(By.Id("userID")).SendKeys("username");
driver.FindElement(By.Id("userPassword")).SendKeys("userPassword");
driver.FindElement(By.Id("login")).Click();
driver.SwitchTo().DefaultContent();
driver.FindElement(By.XPath("//div[@class='something']/ul/li[2]/a")).Click();
driver.FindElement(By.PartialLinkText("someText")).Click(); // *
- At Last call its throw exception after something like 3 ~ 5 seconds and not immediately (When I set Implicit to 60 sec it's find the element!)