title: Select a PrimeFaces radio button with Selenium Webdriver
body: <p>I am trying to write Selenium tests to select a radio button. Below is the html from 'view Source'.  </p>
  
  <pre><code>&lt;table id="surveyForm:surveyUrlType" class="ui-selectoneradio ui-widget" style="width:100%;margin-top:10px;margin-bottom: 10px;"&gt;
      &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;div class="ui-radiobutton ui-widget"&gt;
                  &lt;div class="ui-helper-hidden-accessible"&gt;
                      &lt;input id="surveyForm:surveyUrlType:0" name="surveyForm:surveyUrlType" type="radio" value="TYPED" checked="checked" onchange="com.ssi.feasibility.surveyView.showSurveyType(this);"&gt;
                  &lt;/div&gt;
                  &lt;div class="ui-radiobutton-box ui-widget ui-corner-all ui-state-default ui-state-active"&gt;
                      &lt;span class="ui-radiobutton-icon ui-icon ui-icon-bullet"&gt;&lt;/span&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/td&gt;
          &lt;td&gt;&lt;label for="surveyForm:surveyUrlType:0"&gt;Enter Survey URL&lt;/label&gt;&lt;/td&gt;
          &lt;td&gt;
              &lt;div class="ui-radiobutton ui-widget"&gt;
                  &lt;div class="ui-helper-hidden-accessible"&gt;
                      &lt;input id="surveyForm:surveyUrlType:1" name="surveyForm:surveyUrlType" type="radio" value="FILE" onchange="com.ssi.feasibility.surveyView.showSurveyType(this);"&gt;
                  &lt;/div&gt;
                  &lt;div class="ui-radiobutton-box ui-widget ui-corner-all ui-state-default"&gt;
                      &lt;span class="ui-radiobutton-icon"&gt;&lt;/span&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/td&gt;
          &lt;td&gt;&lt;label for="surveyForm:surveyUrlType:1"&gt;Upload Survey URLs&lt;/label&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I want to select 'Upload Survey URLs' radio button.</p>
  
  <p>I have tried several different approaches to select the radio button. Here are a few:</p>
  
  <pre><code>        $("#surveyForm\\surveyUrlType").click();
  
          This gives me the error : 
          $("#surveyForm\\:surveyUrlType\\:1").first().click()
  </code></pre>
  
  <p>Error- Element is not clickable at point (809, 367). Other element would receive the click: ...</p>
  
  <p>Below give me NoSuchElementFound:</p>
  
  <pre><code>        driver.findElement(By.id("surveyForm:surveyUrlType:1")).click()
          driver.findElement(By.xpath("//input[@type='radio' and @id='surveyForm\\:surveyUrlType\\:1']")).click()
          driver.findElement(By.xpath("//input[@value='FILE']")).click()
          driver.findElement(By.cssSelector("#surveyForm\\:surveyUrlType\\:1")).click()
  </code></pre>
  
  <p>Below don't give me any error but they also do not select the radio button.</p>
  
  <pre><code>        $(".ui-radiobutton-box ui-widget ui-corner-all ui-state-default")[1].click()
          $(".ui-radiobutton-box ui-widget ui-corner-all ui-state-default").click()
          $("#surveyForm\\:surveyUrlType").find(".ui-radiobutton-box ui-widget ui-corner-all ui-state-default").find("span").click()
  </code></pre>
  
  <p>But none of these work. What am I missing?</p>