<rhr-radio-button element-id="tenderValidType" model="$ctrl.additionalData.procProcedure.tenderValidType" value="UNTIL_DATE" label="additionalData.tenderValidUntil" required="::$ctrl.requiredFields['tenderValidType']" read-only="$ctrl.isReadOnly" class="ng-scope ng-isolate-scope">
   <!-- ngIf: $ctrl.horizontal !== 'true' && !$ctrl.readOnly -->
   <div class="radio ng-scope" ng-if="$ctrl.horizontal !== 'true' &amp;&amp; !$ctrl.readOnly">
         <input type="radio" class="px ng-pristine ng-untouched ng-empty ng-invalid ng-invalid-required" name="tenderValidType" ng-value="::$ctrl.value" ng-model="$ctrl.model" ng-required="$ctrl.innerRequired" ng-disabled="$ctrl.disabled" ng-change="$ctrl.onChange()" value="UNTIL_DATE" required="required"> <span class="lbl ng-binding" ng-bind="::($ctrl.label | translate) + '&nbsp;'">Pakkumus peab olema jõus kuni&nbsp;</span><!-- ngIf: $ctrl.showHelpText === 'true' -->
   <!-- end ngIf: $ctrl.horizontal !== 'true' && !$ctrl.readOnly --><!-- ngIf: $ctrl.horizontal === 'true' && !$ctrl.readOnly --><!-- ngIf: $ctrl.readOnly && $ctrl.value == $ctrl.model -->

I've tried everything here, like this:

 await element(by.xpath((//label[contains(@for,'rhr-radio-button')])[1])).click();

and this

await element(by.id('tenderValidType')).all(by.tagName('rhr-radio-button')).get(1).click();

But nothing.. I think I should combine the ID and the value into one xpath, but I don't know how. Any ideas?

  • try this //input[@type='radio']//id[@name='tenderValidType'] Jan 15, 2019 at 9:57

1 Answer 1


It is difficult to suggest things without being able to test or check them, but, according to the information we have and taking into account that there could be multiple rhr-radio-button elements on a page, I'd combine the tag name check and the element-id check:


Note that element-id attribute could not be targeted with the by.id() locator as by.id() looks for id attributes.

One other option, you may try to look for the input element directly:


Note: $('...') here is a shortcut to element(by.css('...')).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.