Skip to content Skip to sidebar Skip to footer

Selenium Error When Using Javascript Or Getting Elements

Using Seleneium 2.25, I've had a lot of issues arise. I'm trying to use Selenium Remote Driver on a remote machine (Server) from my computer (local / client). However, when I try

Solution 1:

Try this:

WebDriverWaitwait=newWebDriverWait(driver, newTimeSpan(0, 0, 0, 30));
wait.Until(p => driver.FindElement(By.Name("searchAddress")));

IJavaScriptExecutorjQuery= ((IJavaScriptExecutor)(driver));
addressElement = (IWebElement)jQuery.ExecuteScript("return document.GetElementByName('searchAddress')");

Also you can add check in JavaScript:

if (document.readyState.toLowerCase()=="complete") 
returndocument.GetElementByName('searchAddress');
return'Error';

Post a Comment for "Selenium Error When Using Javascript Or Getting Elements"