FAQ
Hi All,

I wrote the following code for wait up to load a particular element. But it
shows error in code.

package Practice_pack_1;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

public class WebDriverWait {
     WebDriver driver;
     @BeforeTest
     public void open()
     {
         driver=new FirefoxDriver();
         driver.manage().window().maximize();
         driver.navigate().to("http://epaper.sakshi.com/");
     }
     @AfterTest
     public void teardown()
     {
         driver.quit();
     }
     @Test
     public void brokenlinks() throws InterruptedException
     {
         WebDriverWait wait = new WebDriverWait(driver, 10); //Here one
error is showing
         WebElement element =
wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(".//*[@id='scrollnews']/a[2]")));
   //Here one error is showing

     }
}

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/92c81a68-941d-4c13-8c9e-09d50ceddded%40googlegroups.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Tarun Kumar at May 14, 2013 at 11:19 am
    and the error is?

    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-users@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/55f145ac-c339-4d69-9ef3-9a497fb538d7%40googlegroups.com?hl=en-US.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Mark Collin at May 14, 2013 at 11:21 am
    Good question :)

    I would also expect it to look like:

    WebDriverWait wait = new WebDriverWait(driver, 10, 100);
    On 14/05/2013 12:18, Tarun Kumar wrote:
    and the error is?
    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to selenium-users+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-users@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/selenium-users/55f145ac-c339-4d69-9ef3-9a497fb538d7%40googlegroups.com?hl=en-US.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-users@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • ARK Satyanarayana Raju at May 14, 2013 at 11:38 am
    Hi,

    WebDriverWait wait = new WebDriverWait(driver, 10);
    Here error is:
    Move the cursor on "new WebDriverWait(driver, 10); " it shows
    1) Remove arguments to match 'WebDriverWait()'
    2) Create constructor 'WebDriverWait(WebDriver, int)'

    and

    WebElement element = wait.until(ExpectedConditions.
    presenceOfElementLocated(By.xpath(".//*[@id='scrollnews']/a[2]")));

    Here error is showing at "until". Move the mouse on "until"
    1) create method 'until(ExpectedCondition<WebElement>)'
    2) Add cast to 'wait'

    On Tuesday, May 14, 2013 4:48:45 PM UTC+5:30, Tarun Kumar wrote:

    and the error is?
    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-users@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/ad1bb31d-0801-4652-97f2-0eada3a55c2f%40googlegroups.com?hl=en-US.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Mark Collin at May 14, 2013 at 12:00 pm
    Look at my last post, you have not constructed a WebDriverWait object
    correctly and your IDE is telling you that your code is wrong.

    On 14/05/2013 12:38, ARK Satyanarayana Raju wrote:
    Hi,

    WebDriverWait wait = new WebDriverWait(driver, 10);
    Here error is:
    Move the cursor on "new WebDriverWait(driver, 10); " it shows
    1) Remove arguments to match 'WebDriverWait()'
    2) Create constructor 'WebDriverWait(WebDriver, int)'

    and

    WebElement element = wait.until(ExpectedConditions.
    presenceOfElementLocated(By.xpath(".//*[@id='scrollnews']/a[2]")));

    Here error is showing at "until". Move the mouse on "until"
    1) create method 'until(ExpectedCondition<WebElement>)'
    2) Add cast to 'wait'


    On Tuesday, May 14, 2013 4:48:45 PM UTC+5:30, Tarun Kumar wrote:

    and the error is?

    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to selenium-users+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-users@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/selenium-users/ad1bb31d-0801-4652-97f2-0eada3a55c2f%40googlegroups.com?hl=en-US.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-users@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • ARK Satyanarayana Raju at May 14, 2013 at 12:03 pm
    Hi Mark,

    I tried u r reply but that also showing same error.
    On Tuesday, May 14, 2013 5:30:32 PM UTC+5:30, Mark Collin wrote:

    Look at my last post, you have not constructed a WebDriverWait object
    correctly and your IDE is telling you that your code is wrong.


    On 14/05/2013 12:38, ARK Satyanarayana Raju wrote:

    Hi,

    WebDriverWait wait = new WebDriverWait(driver, 10);
    Here error is:
    Move the cursor on "new WebDriverWait(driver, 10); " it shows
    1) Remove arguments to match 'WebDriverWait()'
    2) Create constructor 'WebDriverWait(WebDriver, int)'

    and

    WebElement element = wait.until(ExpectedConditions.
    presenceOfElementLocated(By.xpath(".//*[@id='scrollnews']/a[2]")));

    Here error is showing at "until". Move the mouse on "until"
    1) create method 'until(ExpectedCondition<WebElement>)'
    2) Add cast to 'wait'

    On Tuesday, May 14, 2013 4:48:45 PM UTC+5:30, Tarun Kumar wrote:

    and the error is?
    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to selenium-user...@googlegroups.com <javascript:>.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/selenium-users/ad1bb31d-0801-4652-97f2-0eada3a55c2f%40googlegroups.com?hl=en-US
    .
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-users@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/1c5670ef-fc32-452a-bd17-ac84ea560073%40googlegroups.com?hl=en-US.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Mark Collin at May 14, 2013 at 12:08 pm
    Check your class path

    On 14/05/2013 13:03, ARK Satyanarayana Raju wrote:
    Hi Mark,

    I tried u r reply but that also showing same error.

    On Tuesday, May 14, 2013 5:30:32 PM UTC+5:30, Mark Collin wrote:

    Look at my last post, you have not constructed a WebDriverWait
    object correctly and your IDE is telling you that your code is wrong.

    On 14/05/2013 12:38, ARK Satyanarayana Raju wrote:
    Hi,

    WebDriverWait wait = new WebDriverWait(driver, 10);
    Here error is:
    Move the cursor on "new WebDriverWait(driver, 10); " it shows
    1) Remove arguments to match 'WebDriverWait()'
    2) Create constructor 'WebDriverWait(WebDriver, int)'

    and

    WebElement element = wait.until(ExpectedConditions.
    presenceOfElementLocated(By.xpath(".//*[@id='scrollnews']/a[2]")));

    Here error is showing at "until". Move the mouse on "until"
    1) create method 'until(ExpectedCondition<WebElement>)'
    2) Add cast to 'wait'


    On Tuesday, May 14, 2013 4:48:45 PM UTC+5:30, Tarun Kumar wrote:

    and the error is?

    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to selenium-user...@googlegroups.com <javascript:>.
    To post to this group, send email to seleniu...@googlegroups.com
    <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/selenium-users/ad1bb31d-0801-4652-97f2-0eada3a55c2f%40googlegroups.com?hl=en-US
    <https://groups.google.com/d/msgid/selenium-users/ad1bb31d-0801-4652-97f2-0eada3a55c2f%40googlegroups.com?hl=en-US>.
    For more options, visit https://groups.google.com/groups/opt_out
    <https://groups.google.com/groups/opt_out>.
    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to selenium-users+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-users@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/selenium-users/1c5670ef-fc32-452a-bd17-ac84ea560073%40googlegroups.com?hl=en-US.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-users@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • ARK Satyanarayana Raju at May 14, 2013 at 12:14 pm
    Sorry, Can u say about class path. I dont know java.
    On Tuesday, May 14, 2013 5:38:38 PM UTC+5:30, Mark Collin wrote:

    Check your class path


    On 14/05/2013 13:03, ARK Satyanarayana Raju wrote:

    Hi Mark,

    I tried u r reply but that also showing same error.
    On Tuesday, May 14, 2013 5:30:32 PM UTC+5:30, Mark Collin wrote:

    Look at my last post, you have not constructed a WebDriverWait object
    correctly and your IDE is telling you that your code is wrong.


    On 14/05/2013 12:38, ARK Satyanarayana Raju wrote:

    Hi,

    WebDriverWait wait = new WebDriverWait(driver, 10);
    Here error is:
    Move the cursor on "new WebDriverWait(driver, 10); " it shows
    1) Remove arguments to match 'WebDriverWait()'
    2) Create constructor 'WebDriverWait(WebDriver, int)'

    and

    WebElement element = wait.until(ExpectedConditions.
    presenceOfElementLocated(By.xpath(".//*[@id='scrollnews']/a[2]")));

    Here error is showing at "until". Move the mouse on "until"
    1) create method 'until(ExpectedCondition<WebElement>)'
    2) Add cast to 'wait'

    On Tuesday, May 14, 2013 4:48:45 PM UTC+5:30, Tarun Kumar wrote:

    and the error is?
    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to selenium-user...@googlegroups.com.
    To post to this group, send email to seleniu...@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/selenium-users/ad1bb31d-0801-4652-97f2-0eada3a55c2f%40googlegroups.com?hl=en-US
    .
    For more options, visit https://groups.google.com/groups/opt_out.




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to selenium-user...@googlegroups.com <javascript:>.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/selenium-users/1c5670ef-fc32-452a-bd17-ac84ea560073%40googlegroups.com?hl=en-US
    .
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-users@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/3f7bc4a7-a35a-40f3-8acd-a94ca34421d6%40googlegroups.com?hl=en-US.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Mark Collin at May 14, 2013 at 12:26 pm
    You need to learn Java then or get somebody who is competent in Java to
    walk you through what you are doing.

    You are currently trying to write Java code.

    You may be better off using another language binding so that you can
    write tests in a language that you do understand. If you don't
    understand any languages I refer you to my first statement.
    On 14/05/2013 13:14, ARK Satyanarayana Raju wrote:
    Sorry, Can u say about class path. I dont know java.

    On Tuesday, May 14, 2013 5:38:38 PM UTC+5:30, Mark Collin wrote:

    Check your class path

    On 14/05/2013 13:03, ARK Satyanarayana Raju wrote:
    Hi Mark,

    I tried u r reply but that also showing same error.

    On Tuesday, May 14, 2013 5:30:32 PM UTC+5:30, Mark Collin wrote:

    Look at my last post, you have not constructed a
    WebDriverWait object correctly and your IDE is telling you
    that your code is wrong.

    On 14/05/2013 12:38, ARK Satyanarayana Raju wrote:
    Hi,

    WebDriverWait wait = new WebDriverWait(driver, 10);
    Here error is:
    Move the cursor on "new WebDriverWait(driver, 10); " it shows
    1) Remove arguments to match 'WebDriverWait()'
    2) Create constructor 'WebDriverWait(WebDriver, int)'

    and

    WebElement element = wait.until(ExpectedConditions.
    presenceOfElementLocated(By.xpath(".//*[@id='scrollnews']/a[2]")));


    Here error is showing at "until". Move the mouse on "until"
    1) create method 'until(ExpectedCondition<WebElement>)'
    2) Add cast to 'wait'


    On Tuesday, May 14, 2013 4:48:45 PM UTC+5:30, Tarun Kumar
    wrote:

    and the error is?

    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails
    from it, send an email to selenium-user...@googlegroups.com.
    To post to this group, send email to
    seleniu...@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/selenium-users/ad1bb31d-0801-4652-97f2-0eada3a55c2f%40googlegroups.com?hl=en-US
    <https://groups.google.com/d/msgid/selenium-users/ad1bb31d-0801-4652-97f2-0eada3a55c2f%40googlegroups.com?hl=en-US>.
    For more options, visit
    https://groups.google.com/groups/opt_out
    <https://groups.google.com/groups/opt_out>.
    --
    You received this message because you are subscribed to the
    Google Groups "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to selenium-user...@googlegroups.com <javascript:>.
    To post to this group, send email to seleniu...@googlegroups.com
    <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/selenium-users/1c5670ef-fc32-452a-bd17-ac84ea560073%40googlegroups.com?hl=en-US
    <https://groups.google.com/d/msgid/selenium-users/1c5670ef-fc32-452a-bd17-ac84ea560073%40googlegroups.com?hl=en-US>.
    For more options, visit https://groups.google.com/groups/opt_out
    <https://groups.google.com/groups/opt_out>.
    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to selenium-users+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-users@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/selenium-users/3f7bc4a7-a35a-40f3-8acd-a94ca34421d6%40googlegroups.com?hl=en-US.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-users@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • ARK Satyanarayana Raju at May 14, 2013 at 12:37 pm
    Thanks for u r suggestion. I found the mistake.
    Here i took class name as " WebDriverWait wait" so it shown a mistake.
    I changed class name. Now working fine.



    On Tuesday, May 14, 2013 5:56:31 PM UTC+5:30, Mark Collin wrote:

    You need to learn Java then or get somebody who is competent in Java to
    walk you through what you are doing.

    You are currently trying to write Java code.

    You may be better off using another language binding so that you can write
    tests in a language that you do understand. If you don't understand any
    languages I refer you to my first statement.

    On 14/05/2013 13:14, ARK Satyanarayana Raju wrote:

    Sorry, Can u say about class path. I dont know java.
    On Tuesday, May 14, 2013 5:38:38 PM UTC+5:30, Mark Collin wrote:

    Check your class path


    On 14/05/2013 13:03, ARK Satyanarayana Raju wrote:

    Hi Mark,

    I tried u r reply but that also showing same error.
    On Tuesday, May 14, 2013 5:30:32 PM UTC+5:30, Mark Collin wrote:

    Look at my last post, you have not constructed a WebDriverWait object
    correctly and your IDE is telling you that your code is wrong.


    On 14/05/2013 12:38, ARK Satyanarayana Raju wrote:

    Hi,

    WebDriverWait wait = new WebDriverWait(driver, 10);
    Here error is:
    Move the cursor on "new WebDriverWait(driver, 10); " it shows
    1) Remove arguments to match 'WebDriverWait()'
    2) Create constructor 'WebDriverWait(WebDriver, int)'

    and

    WebElement element = wait.until(ExpectedConditions.
    presenceOfElementLocated(By.xpath(".//*[@id='scrollnews']/a[2]")));

    Here error is showing at "until". Move the mouse on "until"
    1) create method 'until(ExpectedCondition<WebElement>)'
    2) Add cast to 'wait'

    On Tuesday, May 14, 2013 4:48:45 PM UTC+5:30, Tarun Kumar wrote:

    and the error is?
    --
    You received this message because you are subscribed to the Google
    Groups "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to selenium-user...@googlegroups.com.
    To post to this group, send email to seleniu...@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/selenium-users/ad1bb31d-0801-4652-97f2-0eada3a55c2f%40googlegroups.com?hl=en-US
    .
    For more options, visit https://groups.google.com/groups/opt_out.




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to selenium-user...@googlegroups.com.
    To post to this group, send email to seleniu...@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/selenium-users/1c5670ef-fc32-452a-bd17-ac84ea560073%40googlegroups.com?hl=en-US
    .
    For more options, visit https://groups.google.com/groups/opt_out.




    --
    You received this message because you are subscribed to the Google Groups
    "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to selenium-user...@googlegroups.com <javascript:>.
    To post to this group, send email to seleniu...@googlegroups.com<javascript:>
    .
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/selenium-users/3f7bc4a7-a35a-40f3-8acd-a94ca34421d6%40googlegroups.com?hl=en-US
    .
    For more options, visit https://groups.google.com/groups/opt_out.



    --
    You received this message because you are subscribed to the Google Groups "Selenium Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
    To post to this group, send email to selenium-users@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/e396f97c-f71a-4dd3-a85c-513afc814740%40googlegroups.com?hl=en-US.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupselenium-users @
categoriesselenium
postedMay 14, '13 at 10:39a
activeMay 14, '13 at 12:37p
posts10
users3
websiteseleniumhq.org

People

Translate

site design / logo © 2022 Grokbase