title: How to assert if a radio button is selected through Selenium
body: <p>In Selenium I'm using pseudo selectors to select this radio button input (screen shot below). Then I'm trying to use <code>assertTrue</code> and the method <code>isSelected</code> to see if that radio button is selected. But I get an error.. see below: </p>
  
  <pre><code>import unittest
  from selenium.webdriver import Chrome
  
  class MyTest(unittest.TestCase):
  
      def test_radio_button(self):
          filter_panel = self.browser.find_element_by_class_name('panel-filters')
          radio_button = filter_panel.find_element_by_css_selector('section.section-units &gt; fieldset#filter-units &gt; div.form-group:nth-child(2) &gt; input')
  
          self.assertTrue(radio_button.isSelected());
  </code></pre>
  
  <p>I get this error when running my Selenium test: </p>
  
  <p><strong>self.assertTrue(filter_units.isSelected());
  AttributeError: 'WebElement' object has no attribute 'isSelected'</strong></p>
  
  <p>How can I test if this radio button is selected?</p>
  
  <hr>
  
  <p><a href="https://i.stack.imgur.com/fIyZk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fIyZk.png" alt="enter image description here"></a></p>