title: driver.findElement(By.cssSelector(..)) Selenium Not Working In Windows 10
body: <p>I'm having issues with CSS Selector in <code>Selenium</code> and <code>windows 10</code>. Tag seems to be incorrect. And, I'm not sure what's wrong. Can you please help?</p>
  <pre><code>import java.util.concurrent.TimeUnit;
  import org.openqa.selenium.By;
  import org.openqa.selenium.By.ById;
  import org.openqa.selenium.By.ByXPath;
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.chrome.ChromeDriver;
  import org.openqa.selenium.ie.InternetExplorerDriver;
  
  public class Locator2 {
  
      public static void main(String[] args) {
          
          System.setProperty(&quot;webdriver.chrome.driver&quot;,&quot;C:\\Users\\abhij\\Desktop\\seliniumjars\\chromedriver.exe&quot;);
          
          WebDriver driver=new ChromeDriver();
          driver.get(&quot;https://login.yahoo.com/?.src=ym&amp;.intl=us&amp;.lang=en-       US&amp;.done=https%3a//mail.yahoo.com&quot;);
          driver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS);
          //driver.findElement(By.xpath(&quot;.//*[@id='login-username']&quot;)).sendKeys(&quot;asdfasd&quot;);
          driver.findElement(By.cssSelector(&quot;input[id='login-username']]&quot;)).sendKeys(&quot;asdfasd&quot;);
  
          //driver.findElement(By.cssSelector(&quot;input[id='login1']&quot;)).sendKeys(&quot;asdfasd&quot;);
          //driver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS);
          //driver.findElement(By.cssSelector(&quot;input[name='login1']&quot;)).sendKeys(&quot;asdfasd&quot;);   
      }
  }
  </code></pre>
  <p>Exception:</p>
  <pre><code>&gt;Exception in thread &quot;main&quot; org.openqa.selenium.InvalidElementStateException: invalid element state: Failed to execute 'querySelector' on 'Document': 'input[id='login-username']]' is not a valid selector
  </code></pre>