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

[🐛 Bug]: Webdriver Wait is not working in selenium C# and this issue exists for both implicit and explicit wait time. #15404

Open
sathisharumugamag opened this issue Mar 12, 2025 · 1 comment

Comments

@sathisharumugamag
Copy link

What happened?

I'm currently encountering a potential issue with our existing selenium C# framework. For some reason, the wait time isn't functioning correctly in the Selenium C# environment. As I check with Java it is functioning properly but C# is failing with both implicit and explicit waits.

Relying on Thread.Sleep to create a global wait isn't the best practice for automation scripting, as it can lead to longer execution times.

Please take a look at the attached video; based on the wait time, the script should pause at that line instead of moving immediately. Here the wait time was 8333333 minutes.

Video Recording:
https://drive.google.com/file/d/1zY8n4H98DzIDiTCtoR_08tHJ9E3szeVk/view?usp=sharing

Automation Tech Stack:
Language : C#
Selenium WebDriver :
Selenium Support:
Selenium wait :

How can we reproduce the issue?

Here is the sample of implicit and explicit wait 

public void ImplicitWait()
{
driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5000);
}

public void ExplicitWait()
{
     WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(5000));
     wait.Until(ExpectedConditions.ElementIsVisible(By.Id(ID)));
}

Relevant log output

Selenium Wait is not working hence the driver immediately looks for my element and it is not enabled on the web page, so it is throwing this error. 

Message: 
OpenQA.Selenium.ElementNotInteractableException : element not interactable
  (Session info: MicrosoftEdge=133.0.3065.92)

  Stack Trace: 
WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)
WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
WebDriver.InternalExecute(String driverCommandToExecute, Dictionary`2 parameters)
WebElement.Execute(String commandToExecute, Dictionary`2 parameters)
WebElement.SendKeys(String text)

Operating System

Windows 10

Selenium version

C# 4.29.0

What are the browser(s) and version(s) where you see this issue?

IE edge, Chrome, Firefox

What are the browser driver(s) and version(s) where you see this issue?

MicrosoftEdge=133.0.3065.92, chrome=133.0.6943.142

Are you using Selenium Grid?

No

Copy link

@sathisharumugamag, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

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

No branches or pull requests

1 participant