The best solution is not to use the click () method, but to perform actions and selenium (via webdriver) to simulate mouse movement over an element to activate events that then make the element clickable / enabled. as soon as you activate the element, then, if necessary, execute the click () method. I assume the item is disabled, which makes it not clickable in the first place.
Create your own element, which you can also use RenderedWebElement, which has the hover () method, then you will not need to create the next Actions object, but it may not work depending on how the application is developed using its own events. Try both that work best and are the most elegant.
WebElement element = driver.findElement(By.id("element_id"));
Create a new actions object supported by webdriver
Actions actions = new Actions(driver);
Move the cursor to the element - this "activates" your element for click
actions.moveToElement(element).perform();
Verify that the item is now clickable or enabled
assertThat(element.isEnabled());
Now do click action
element.click();
source share