Skip to content

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

@sathisharumugamag

Description

@sathisharumugamag

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!B-supportIssue or PR related to support classesC-dotnet.NET BindingsI-defectSomething is not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions