Member-only story
Click Radio Buttons in Materialize Using Selenium WebDriver
How to use Selenium WebDriver to click Materialize’s transformed radio buttons
Non-Medium Readers: You can read this article for free on Substack.
Materialize is a web design framework based on Material Design. While Materialize is not popular as BootStrap or Tailwind, it is still quite commonly used.
In this article, I will walkthrough how to click a Materialize radio button — warning, it’s not as straightforward as it looks!
Here’s an example Materialize radio button used in WhenWise. You can have a play with sample Materialize radio buttons here on their website.
The HTML fragment for the “Service” radio button is:
Beginner automated testers will think “that is easy”, and try with the following script statement (using the ID attribute is_service_true
):
driver.find_element(:id, "is_service_true").click
However, you will get this error:
Selenium::WebDriver::Error::ElementClickInterceptedError:
element click intercepted: Element is not clickable at point (481, 138). Other element would receive the click: ...
(Session info: chrome=138.0.7204.50)