In selenium automation, I'm trying to execute jquery script in IE 11 browser but while executing the script it's throwing the below error. Also, the same code which is working in chrome browser with out any issues.
Below are the code:
IJavaScriptExecutor js = _driver as IJavaScriptExecutor;
string query = "return jQuery('#myID').parent();";
var objElement = js.ExecuteScript(query);
foreach (IWebElement element in (IEnumerable)objElement)
{
_webElement = element;
}
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.InternalExecute(String driverCommandToExecute, Dictionary2 parameters)
at OpenQA.Selenium.Remote.RemoteWebElement.Execute(String commandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebElement.get_Text()
Note: Also, i tried some other script which is working in Ie browser.
Like click the button,
IJavaScriptExecutor js = _driver as IJavaScriptExecutor;
string query = "return jQuery('#myID').parent().click();"
var objElement = js.ExecuteScript(query);
Please help me on this.
Much apperciate your help.
