var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(6));
wait.Until(ExpectedConditions.ElementExists(By.XPath("//span")));
//Fails with "{"Timed out after 6 seconds"}"
//and with the innerException = {"The xpath expression '//span' cannot be evaluated or does notresult in a WebElement"}
var service = InternetExplorerDriverService.CreateDefaultService();
service.LogFile = @"C:\IE.log";
service.LoggingLevel = InternetExplorerDriverLogLevel.Trace;
return new InternetExplorerDriver(service, options);
Then I get the following trace logs:
D 2016-05-03 13:46:49:029 ElementFinder.cpp(53) Using FindElement atom to locate element having xpath = //span
T 2016-05-03 13:46:49:029 Browser.cpp(120) Entering Browser::GetDocument
T 2016-05-03 13:46:49:029 Browser.cpp(602) Entering Browser::GetDocumentFromWindow
T 2016-05-03 13:46:49:036 Script.cpp(44) Entering Script::Initialize
T 2016-05-03 13:46:49:037 Script.cpp(65) Entering Script::AddArgument(std::wstring)
T 2016-05-03 13:46:49:037 Script.cpp(100) Entering Script::AddArgument(VARIANT)
T 2016-05-03 13:46:49:037 Script.cpp(65) Entering Script::AddArgument(std::wstring)
T 2016-05-03 13:46:49:037 Script.cpp(100) Entering Script::AddArgument(VARIANT)
T 2016-05-03 13:46:49:037 Script.cpp(164) Entering Script::Execute
T 2016-05-03 13:46:49:037 Script.cpp(472) Entering Script::CreateAnonymousFunction
W 2016-05-03 13:46:49:043 Script.cpp(489) -2147024891 [Access is denied.]: Unable to execute code, call to IHTMLWindow2::execScript failed
W 2016-05-03 13:46:49:043 Script.cpp(175) Cannot create anonymous function
W 2016-05-03 13:46:49:043 ElementFinder.cpp(84) Attempted to find element using invalid xpath: //span
T 2016-05-03 13:46:49:044 response.cc(76) Entering Response::SetErrorResponse
W 2016-05-03 13:46:49:044 response.cc(77) Error response has status code 32 and message 'The xpath expression '//span' cannot be evaluated or does notresult in a WebElement' message
Here I clearly get an error:
"Script.cpp(489) -2147024891 [Access is denied.]: Unable to execute code, call to IHTMLWindow2::execScript failed"
Does anyone know how I should go about this error. Is there some setup I should try beside the ones descriped at https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver