Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with timeout for step "I wait <duration> seconds for element having xpath ..." #5

Open
NachiketPawar opened this issue Jan 23, 2017 · 0 comments

Comments

@NachiketPawar
Copy link

Hi,
We observed issue with "I wait 20 seconds for element having xpath "XPATH" to display" and
same step for element to get enable.
Let's say if we define time for wait as 20 seconds , then it is actually waiting for 20 * 1000 i.e 20000 seconds.
This is because of following code.

  public void waitForElementToDisplay(String accessType, String accessName,  String duration) {
	By byEle = getelementbytype(accessType, accessName);
	WebDriverWait wait = (new WebDriverWait(driver, Integer.parseInt(duration) * 1000));
  	wait.until(ExpectedConditions.visibilityOfElementLocated(byEle));
}

           public void waitForElementToClick(String accessType, String accessName, String duration) {
	By byEle = getelementbytype(accessType, accessName);
	WebDriverWait wait = (new WebDriverWait(driver, Integer.parseInt(duration) * 1000));
	wait.until(ExpectedConditions.elementToBeClickable(byEle));
}

We should not multiply duration with 1000. Please remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant