Selenium Automation using IE 11 on Win 10 - find element by css is not working when js script executer is used

Not reproducible Issue #19411354


undefined u.
Oct 25, 2018
This issue is public.
Found in
  • Internet Explorer
Reported by 2 people

Sign in to watch or report this issue.

Steps to reproduce

I am running automation script using Selenium 3.13 version on IE 11 browser. I am using Win 10 environment.
My automation fails when IE 11 tries to select a resource tree by clicking expand collapse node. My original code contains finding element (the expand collapse node is an image element) using css - element.findElement(By.cssSelector("img:nth-child(2)"))

I am using javascript executor to click on this image elememt. But the code fails and throws null pointer exception in the line below

WebElement imgElement =element.findElement(By.cssSelector("img:nth-child(2)"));


public void jsClick(WebElement element)
JavascriptExecutor js = (JavascriptExecutor) driver;

    js.executeScript("arguments[0].click();", element);


please help.
The code fails in this line -js.executeScript("arguments[0].click();", element); and throws null pointer exception.


0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Status to “Not reproducible”

    You need to sign in to your Microsoft account to add a comment.

    Sign in