Skip to content

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

@NachiketPawar

Description

@NachiketPawar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions