title: How to extract the display attribute of an element using Selenium Webdriver and Java
body: <p>unable to locate the hidden element in div</p>
  
  <pre><code>&lt;div id="divDuplicateBarcodeCheck" class="spreadsheetEditGui" style="z- 
  
   index: 1200; width: 640px; height: 420px; top: 496.5px; left: 640px; 
  
  display:block"&gt; ==$0
  </code></pre>
  
  <p>I want to locate the display element, but the element is hidden, i have written the  code for it too.</p>
  
  <pre><code>String abc=d.findElement(By.xpath("//div[@id='divDuplicateBarcodeCheck']/"))
  .getAttribute("display");
   System.out.println(abc);
   Thread.sleep(3000);
   if(abc.equalsIgnoreCase("block"))      
   {          
   d.findElement(By.id("duplicateBarcodeCheck")).click();   
  System.out.println("duplicate barcode Close");                                              
  }
  else    
  {    System.out.println("Barcode selected");}
  </code></pre>