This textbox works in WATIR-Webdriver but not in watir-classic

139 Views Asked by At
<input name="namedDriverGivenName" class="form-control ng-invalid ng-invalid-required ng-dirty" id="namedDriverGivenName" required="required" type="text" placeholder="Required" data-ng-model="namedDriver.FirstName" data-ng-required="true">

The aforementioned text box works when I write the following code in watir-webdriver 'b.text_field(:name,'namedDriverGivenName').set 'raj' but the same code is not working in watir-classic, Can anyone please guide me what might be the problem?

EDIT

 <input name="mainContactPolicyholder" class="form-control ng-pristine ng-valid ng-valid-required" id="mainContactPolicyholder" required="required" type="text" maxlength="8" placeholder="Required" data-ng-model="phContact.PrimaryPhoneNumber" data-ng-required="true" minlength="8" data-da-hk-mobile-no="">


 <input name="emailReEnterPolicyholder" class="form-control ng-isolate-scope ng-invalid ng-invalid-required ng-valid-email ng-dirty ng-valid-da-confirm-input" id="emailReEnterPolicyholder" required="required" type="email" placeholder="Required" data-ng-model="phContact.PrimaryEmailAddressReenter" data-ng-required="true" data-prevent-cut-copy-paste-input="" data-da-confirm-input-field-to-compare="phContact.PrimaryEmailAddress" data-da-confirm-input="">

puts b.text_field(:id,'mainContactPolicyholder').exists? => true

puts b.text_field(:id,'emailReEnterPolicyholder').exists? => false

The above two text boxes exist in my page, but first one give the result true and the second one gives the result false, but when I use Watir-Webdriver it recognizes both the text boxes correctly, Why it is the case?

1

There are 1 best solutions below

9
On

The quick answer is not to use Watir classic. We'll be updating the documentation soon to indicate its status as a deprecated project. Focus on getting your tests to work with Watir webdriver.