Prashant,
There is no straight forward way of doing this [ in any ways you would be required to sweep through your code and make changes in a lot of places ].
So what I would suggest is that you please consider creating a utility class [ Lets call it WebDriverUIActionsHelper] and define a click method in it, which takes in a WebElement as an argument and internally attempts to first invoke the WebElement.click() and if that doesn’t work, then resort to your JavaScript work-around.
That way, you still have abstracted out all the actual WebElement.click() calls and you don’t have to apply the workaround in each and every place.
Would that work for you ?
Thanks & Regards
Krishnan Mahadevan
"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"