title: How to get ng-model value of Radio button using Jasmine and Karma in AngularJS 1.x
body: <p>I am new to Jasmine and Karma</p>
  
  <p>I am testing an AngularJS application using Jasmine+Karma</p>
  
  <p>My Html looks like this:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="form"&gt;
    &lt;div id="car-type"&gt;
      &lt;input type="radio" ng-model="$ctrl.carType" ng-change="$ctrl.onTypeChange()" name="carType"
                          ng-value="true"/&gt;
                  &lt;span class="label"&gt;Honda&lt;/span&gt;
                  &lt;input type="radio" ng-model="$ctrl.carType" ng-change="$ctrl.onTypeChange()" name="carType"
                          ng-value="false"/&gt;
                  &lt;span class="label"&gt;Mazda&lt;/span&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>However, when I try getting the value of the model bound to the input radio button, true is returned (because of ng-value I believe):</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var wrapperForm = element[0].querySelector('#form');
  
  // Returns true
  console.log(wrapperForm.querySelector('#car-type input').value);</code></pre>
  </div>
  </div>
  </p>
  
  <p>But, I want the model value bound to the radio button.</p>
  
  <p>I don't know how to retrieve the model value bound to the radio button ($ctrl.carType).</p>
  
  <p>Is there a way to retrieve it using the querySelector?</p>
  
  <p>Can someone please help me out?</p>