Error message when I select COMPOSE button after logging into mail.yahoo page

After logging into yahoo page with valid username and password and once I click COMPOSE why there is error message displayed as “NosuckElementfound” .

This is the code which I tried

driver=new FirefoxDriver();
driver.get("http://mail.yahoo.com/");
// enter a valid email address
driver.findElement(By.xpath(".//*[@id='login-username']")).sendKeys("x");
//enter password
driver.findElement(By.xpath(".//*[@id='login-passwd']")).sendKeys("y");
// click on sign in button
driver.findElement(By.xpath(".//*[@id='login-signin']")).click();
Thread.sleep(30000);
// click on compose button
driver.findElement(By.xpath(".//*[@id='yui_3_16_0_1_1444793091198_1864']")).click();
// click on attach files icon
driver.findElement(By.xpath(".//*[@id='attachment-button-input']")).click();

How can we find the elements COMPOSE and ATTACH FILES options after logging into Yahoo page?
How can we work with the links on the page after we sign in to Yahoo ?

Train Asked on October 14, 2015 in Selenium WebDriver.
Add Comment
  • 2 Answer(s)

    You need to check the xpath of ‘Compose’ button first.

    Try to click on Compose button by finding ID or by Class name or by CSS Selector. This will definitely serve the purpose.

    Train Answered on October 14, 2015.
    Add Comment

     

    Yes I got it I tried with invalid XPATH. Now it works.

    Train Answered on October 14, 2015.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.