I'm encountering an issue where Selenium is detecting an element as disabled, despite it being enabled. To work around this, I am attempting to click on the element using JavaScript with the following code snippet:
IWebElement button = driver.FindElement(By.XPath(ButtonXpath));
((IJavaScriptExecutor)driver).ExecuteScript("arguments[0].click()", button);
However, when running this code, nothing happens. The script proceeds without clicking the button (or anchor in this case), and since the anchor does not have an ID, I am unable to use that as a selector.
What can be done to ensure the click event gets triggered properly?
Appreciate any insights or suggestions.
Thank you, Rahul