title: Selenium : Automating LinkedIn - Profile Icon
body: <p>I am new to Selenium and trying to use Actions class to  mouseover on the Profile icon available on linked in site to open the menu that appears on Mouseover of profile image.</p>
  
  <p>Below is my code and when it reaches on to those lines the error comes : <strong>Unable to locate element..</strong></p>
  
  <p>This is happening with all the icons available on Linked on top bar ( messages / Flag icon etc.</p>
  
  <p>Code :</p>
  
  <pre><code>public class LinkedIn {
      WebDriver driver = new FirefoxDriver();
      @BeforeTest
      public void setUp() throws Exception { 
  
          String baseUrl = "http://www.linkedin.com/";    
          driver.get(baseUrl);
  
      }
  
  
      @Test
      public void login() throws InterruptedException
      {
          WebElement login = driver.findElement(By.id("login-email"));
          login.sendKeys("*****@gmail.com");
  
          WebElement pwd = driver.findElement(By.id("login-password"));
          pwd.sendKeys("*****");
  
  
          WebElement in = driver.findElement(By.name("submit"));
          in.click();
  
          Thread.sleep(10000);
      }
  
  
       @Test
          public void profile()  {
      // here it gives error to me : Unable to locate element
          Actions action = new Actions(driver);
          WebElement profile = driver.findElement(By.xpath("//*[@id='img-defer-id-1-25469']"));
          action.moveToElement(profile).build().perform();
            driver.quit();
      }
  
  
  }
  </code></pre>