I am trying to clear the input filter value and verify the result table. Clear() method clears the value but on clear event doesn’t seems to be bubbling up to the DOM. I also tried with JavaScript Executor to mimic real user interaction.
IWebElement inputElement = driver.FindElement(By.xpath("//input[@data-label='PO Number']"));
// Clear the input element
inputElement.Clear();
IJavaScriptExecutor jsExecutor = (IJavaScriptExecutor)driver;
jsExecutor.ExecuteScript("arguments[0].dispatchEvent(new Event('change', { bubbles: true }))", inputElement);
Any idea what I might be missing?
Thanks