title: Why does Gmail change id elements of some elements?
body: <p>This is an element from Gmail, exactly the "Compose" button. Look the id, it is ":il" when i don't have unread messages.</p>
  
  <pre><code>&lt;div id=":il" class="aic"&gt;
  &lt;div class="z0"&gt;
  &lt;div class="T-I J-J5-Ji T-I-KE L3" tabindex="0" role="button" style="-moz-user-select: none;" gh="cm"&gt;COMPOSE&lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt; 
  </code></pre>
  
  <p>Now I just sent an email to myself, and log off my account and log in again. When I inspect the element the id has changed to ":3l".</p>
  
  <pre><code>&lt;div id=":3l" class="aic"&gt;
  &lt;div class="z0"&gt;
  &lt;div class="T-I J-J5-Ji T-I-KE L3 T-I-JO" tabindex="0" role="button" style="-moz-user-select: none;" gh="cm"&gt;COMPOSE&lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Then i read the mail, log off and log in again. When i read the element i am getting the original id ":il".</p>
  
  <p>Why does Gmail change id elements of some elements? I am working with WebDriver and Java and this is driving me crazy. May be I have to change the way to locate this element.</p>
  
  <p>Best Regards!</p>
  
  <p>Added my test coded:</p>
  
  <pre><code>public static void main(String[] args) 
  {
      WebDriver driver;
      String baseUrl;
  
      driver = new FirefoxDriver();
      baseUrl = "https://www.google.com.ar/";
      driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
  
      driver.get(baseUrl + "/?gfe_rd=cr&amp;ei=Tf_YVKv1G6yB8Qe_24HYDA&amp;gws_rd=ssl");
      driver.findElement(By.linkText("Gmail")).click();
      driver.findElement(By.id("Passwd")).clear();
      driver.findElement(By.id("Passwd")).sendKeys("Not neccesary :D");
      driver.findElement(By.id("Email")).clear();
      driver.findElement(By.id("Email")).sendKeys("Not_neccesary_:D");
      driver.findElement(By.id("signIn")).click();
  
      //APARENTLY THERE ARE PROBLEMS WHEN I HAVE MESSAGES UNREADED
  
      driver.findElement(By.xpath("//div[.='COMPOSE']")).click();
      driver.findElement(By.id(":uv")).sendKeys("Not_neccesary_:D@gmail.com");
      driver.findElement(By.id(":ul")).sendKeys("Test");
      driver.findElement(By.id(":vn")).sendKeys("aaaaaaaaaaa");
      driver.findElement(By.id(":ub")).click();
  
      driver.close();
  }
  </code></pre>