0

I have tried running the Gradle script locally from the eclipse and it has runned successfully.But when I tried to run from the Jenkins by creating "Job". I'm getting this error wherever I have used Explicit wait in my selenium code

enter image description here

Help me to get rid of it. Thanks in advance.

CEH
  • 5,701
  • 2
  • 16
  • 40
APV
  • 57
  • 8

1 Answers1

0

This error message...

org.openqa.selenium.TimeoutException: Expected condition failed: waiting for element to be clickable: Proxy element for: DefaultElementLocator 'By.id: user email' (tried for 500 second(s) with 500 milliseconds interval)

...implies that the TimeoutException was raised while attempting to click on the element inducing WebDriverWait.

The relevant HTML of the element along with your code trials would have helped us to analyze the issue in a better way. However, the Locator Strategy as 'By.id: user email' looks incorrect to me.


Solution

As a solution you can try either of the following solutions:

  • cssSelector:

    new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.cssSelector("#user"))).click();
    
  • xpath:

    new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.xpath("//*[contains(@id,'user')]"))).click();
    
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352