I'm having trouble clicking on an element with the style "display: block;" and can't seem to make it work.
Here is the sample html
snippet
<div class="fl f18 dtoggler pointer underline some-padding new_data_entry" data-div-id="eBWJcg" data-div-ref="new_Passport_form.eBWJcg">+ Add Passport</div>
<div class="clear new_Passport_form qEgULQ some-margin togglable" style="display: none;">
Selenium
script:
driver.get("idfystaging.com/users/sign_in");
driver.findElement(By.name("user[login]")).sendKeys("rustam1@yopmail.com");
driver.findElement(By.name("user[password]")).sendKeys("Password123");
driver.findElement(By.name("commit")).click();
driver.switchTo().frame("upload_iframe_1");
driver.findElement(By.cssSelector("body")).sendKeys(Keys.ESCAPE);
JavascriptExecutor executor= (JavascriptExecutor)driver;
executor.executeScript("document.getElementById('qEgULQ').style.display='block';").click();
Error message:
Cannot read property 'style' of null.