There is an easier way to work around the problem using JavascriptExecutor.
For example:
document.getElementsByClassName('post-tag')[0].click();
The above javascript would click, even if it is hidden (hypothetically).
All you need to do is issue this JS instruction via the JavascriptExecutor interface like:
(JavascriptExecutor(webdriver)).executeScript("document.getElementsByClassName('post-tag')[0].click();");
This would use the JS sandbox and synthetic click event to perform the click action. Although it defeats the purpose of WebDriver user activity simulation, you can use it in niche scenarios like in your case to good effect.
Follow @TestingQ
For example:
document.getElementsByClassName('post-tag')[0].click();
The above javascript would click, even if it is hidden (hypothetically).
All you need to do is issue this JS instruction via the JavascriptExecutor interface like:
(JavascriptExecutor(webdriver)).executeScript("document.getElementsByClassName('post-tag')[0].click();");
This would use the JS sandbox and synthetic click event to perform the click action. Although it defeats the purpose of WebDriver user activity simulation, you can use it in niche scenarios like in your case to good effect.