How to Run Selenium Script on Ie

Unable to run JavaScript in IE using Selenium

You should try to find element using selenium script and need to paas it as an arguments to ExecuteScript() as below :-

string script = "arguments[0].remove();"; 

IWebElement element = Driver.WebDriver.FindElement(By.ClassName("ITLCover"));

((IJavaScriptExecutor) Driver.WebDriver).ExecuteScript(script, element);

Edited :- If you want to pass list of IWebElement, and perform script using index, try as :-

int index = 0;
string script = "arguments[0][arguments[1]].remove();";

((IJavaScriptExecutor) Driver.WebDriver).ExecuteScript(script, Driver.WebDriver.FindElements(By.ClassName("ITLCover")), index);

make Selenium not think something is loading in IE

Try once using Actions as
Actions act = new Actions(driver); act.sendKeys(element, "Testingusername");



Related Topics



Leave a reply



Submit