FAQ
Hello

I'm experimenting with Selenium2(Webdriver) and I think I have found a
bug. I login to yahoomail and try to click on compose which does not
throw an exception but it does not click as well Here is the test

WebDriver driver = new FirefoxDriver();
driver.navigate().to("http://mail.yahoo.com");

driver.findElement(By.xpath("//*[@id=\"username
\"]")).sendKeys("davidjesse139@yahoo.com");
driver.findElement(By.xpath("//*[@id=\"passwd
\"]")).sendKeys("a12345678");
driver.findElement(By.xpath("//*[@id=\".save\"]")).click();
try
{
Thread.sleep(3000);
}
catch (InterruptedException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
//this is the one that does not work.
driver.findElement(By.xpath("//span/a")).click();
System.out.println("done!");

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

Search Discussions

  • Ashok Tulachan at May 4, 2012 at 12:55 am
    I don't think that's an error.

    Putting thread.sleep for time out is horrible way of scripting for selenium
    since selenium might sometimes find the element faster or slower due to
    which script might fail.

    Use the for loop creating your own method for waiting until next element is
    present.

    Use this discussion thread for more details.

    https://mail.google.com/mail/u/0/?shva=1#search/waitforelement/1362aa5f9c4cdf88
    On Thu, May 3, 2012 at 7:23 PM, Arya wrote:

    Hello

    I'm experimenting with Selenium2(Webdriver) and I think I have found a
    bug. I login to yahoomail and try to click on compose which does not
    throw an exception but it does not click as well Here is the test

    WebDriver driver = new FirefoxDriver();
    driver.navigate().to("http://mail.yahoo.com");

    driver.findElement(By.xpath("//*[@id=\"username
    \"]")).sendKeys("davidjesse139@yahoo.com");
    driver.findElement(By.xpath("//*[@id=\"passwd
    \"]")).sendKeys("a12345678");
    driver.findElement(By.xpath("//*[@id=\".save\"]")).click();
    try
    {
    Thread.sleep(3000);
    }
    catch (InterruptedException e)
    {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
    //this is the one that does not work.
    driver.findElement(By.xpath("//span/a")).click();
    System.out.println("done!");

    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at
    http://groups.google.com/group/selenium-users?hl=en.

    --
    Regards,

    Ashok Tulachan

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
  • Ats at Aug 16, 2012 at 3:05 pm
    hello,

    Do you a solution for this bug (yahoo-compose mail) ? I have the same
    problem...

    Regards,

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/AM-h4JJYnZ4J.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Anji Prassana at Aug 17, 2012 at 5:14 am
    After you click on save button, you are waiting for just 3 seconds.So,
    Instead of depending on it, wait till the element is present.Which returns
    from wait as soon as the element is present.use webDriverwait of
    selenium to achieve this as follows...

    WebDriver driver = new FirefoxDriver();
    driver.navigate().to("http://mail.yahoo.com");

    driver.findElement(By.xpath("//*[@id=\"username
    \"]")).sendKeys("davidjesse139@yahoo.com");
    driver.findElement(By.xpath("//*[@id=\"passwd
    \"]")).sendKeys("a12345678");
    driver.findElement(By.xpath("//*[@id=\".save\"]")).click();
    Here, remove try{sleep(..)} function and Add the below code.
    By compose=By.xpath("//span/a"); //I am assuming this is the link of your
    compose button.

    //Note: If the above xpath doesn't work, then try using the below line of
    code to find the link..
    //By.linktext("Compose");//Assuming this hyperlink has a text 'Compose'.If
    not change it here accordingly..

    Webdriverwait wait=new WebDriverwait(driver,10);
    wait.until(ExpectedConditions.presenseofElementLocated(compose);
    driver.findElement(compose).click();


    On Fri, May 4, 2012 at 5:53 AM, Arya wrote:

    Hello

    I'm experimenting with Selenium2(Webdriver) and I think I have found a
    bug. I login to yahoomail and try to click on compose which does not
    throw an exception but it does not click as well Here is the test

    WebDriver driver = new FirefoxDriver();
    driver.navigate().to("http://mail.yahoo.com");

    driver.findElement(By.xpath("//*[@id=\"username
    \"]")).sendKeys("davidjesse139@yahoo.com");
    driver.findElement(By.xpath("//*[@id=\"passwd
    \"]")).sendKeys("a12345678");
    driver.findElement(By.xpath("//*[@id=\".save\"]")).click();
    try
    {
    Thread.sleep(3000);
    }
    catch (InterruptedException e)
    {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
    //this is the one that does not work.
    driver.findElement(By.xpath("//span/a")).click();
    System.out.println("done!");

    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to
    selenium-users+unsubscribe@googlegroups.com.
    For more options, visit this group at
    http://groups.google.com/group/selenium-users?hl=en.

    --
    Thanks&Regards
    Anjaneyulu P
    "The way you see the things is the way to think and is the way you react
    upon!!"

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To post to this group, send email to selenium-users@googlegroups.com.
    To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupselenium-users @
categoriesselenium
postedMay 4, '12 at 12:23a
activeAug 17, '12 at 5:14a
posts4
users4
websiteseleniumhq.org

People

Translate

site design / logo © 2022 Grokbase