help needed regarding wait !!

99 views
Skip to first unread message

Pravin Shetty

unread,
Feb 17, 2013, 7:13:11 AM2/17/13
to seleniu...@googlegroups.com
Hi,

Can body help me with some code if i want to wait for some element to exist or load and then proceed execute further action.
i tried with 
new WebDriverWait(driver, 5000).until(ExpectedConditions.presenceOfElementLocated(By.name("corrAddressFrst")));
 driver.findElement(By.name("corrPinCode")).sendKeys("500500");

But its not working.
Thanks !!

kak...@curoonline.com

unread,
Feb 17, 2013, 9:54:30 AM2/17/13
to seleniu...@googlegroups.com
hi,

below is a code in red and the API's you may use as you wish.


WebDriverWait wait = new WebDriverWait(FireFoxDriver, 10);

WebElement element = wait.until(ExpectedConditions.visibilityOfElementLocated(By.className(“list-cnt”)));

  • visibilityOf(WebElement element) – An expectation for checking that an element, known to be present on the DOM of a page, is visible.
  • titleIs(java.lang.String title) – An expectation for checking the title of a page.
  • titleContains(java.lang.String title) - An expectation for checking that the title contains a case-sensitive substring
  • textToBePresentInElementValue(By locator, java.lang.String text) – An expectation for checking if the given text is present in the specified elements value attribute.
  • textToBePresentInElement(By locator, java.lang.String text) – An expectation for checking if the given text is present in the specified element.
  • stalenessOf(WebElement element) – Wait until an element is no longer attached to the DOM.
  • refreshed(ExpectedCondition<T> condition) – Wrapper for a condition, which allows for elements to update by redrawing.
  • presenceOfElementLocated(By locator) – An expectation for checking that an element is present on the DOM of a page.
  • presenceOfAllElementsLocatedBy(By locator) – An expectation for checking that there is at least one element present on a web page.
  • not(ExpectedCondition<?> condition) - An expectation with the logical opposite condition of the given condition.
  • invisibilityOfElementWithText(By locator, java.lang.String text) – An expectation for checking that an element with text is either invisible or not present on the DOM.
  • invisibilityOfElementLocated(By locator) – An expectation for checking that an element is either invisible or not present on the DOM.
  • frameToBeAvailableAndSwitchToIt(java.lang.String frameLocator) – An expectation for checking whether the given frame is available to switch to.
  • elementToBeSelected(WebElement element) – An expectation for checking if the given element is selected.
  • elementToBeSelected(By locator)
  • elementToBeClickable(By locator) – An expectation for checking an element is visible and enabled such that you can click it.

WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.id(“someid”)));

Kwame Akuffo
07891268149

--
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/msg/selenium-users/-/Z6tWdQYK0dcJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

kak...@curoonline.com

unread,
Feb 17, 2013, 10:18:04 AM2/17/13
to seleniu...@googlegroups.com
Hi all,

Below is a link to a good documentation I found on Reading and Understanding Java’s API Documentation






On 17 Feb 2013, at 12:13, Pravin Shetty <pravi...@gmail.com> wrote:

Pravin Shetty

unread,
Feb 17, 2013, 11:56:33 AM2/17/13
to seleniu...@googlegroups.com
Thanks for the reply !!

Manoj K

unread,
Feb 18, 2013, 9:27:07 AM2/18/13
to seleniu...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages