Hi,
We are writing some end to end tests for our application and we wanted to use our custom testing library which utilizes basic HTML & Javascript functionality. We use this library for all our web applications, regardless of the framework it was written in.
We are currently having issues on how to get the value of a Angular UI Kendo Textbox. We can get the element by doing document.querySelector('#myField') and returns the element...
<input _ngcontent-ng-c1188706083="" kendotextbox="" formcontrolname="my_field" type="text" id="myField"
qa-target="user-my-field-input" ng-reflect-name="my_field"
class="ng-untouched ng-pristine ng-valid k-textbox k-input k-input-md k-rounded-md k-input-solid">
Doing document.querySelector('#myField').innerHTML or document.querySelector('#myField').innerText just gives a value of "".
How do I get the value that was entered in the textbox?
Thanks!
PS. This textbox is part of a form and looks like this in the template
<form [formGroup]="theForm" class="k-form">
<fieldset class="k-form-fieldset">
<h4 class="k-pb-4">Some Information</h4>
<div class="name-wrapper k-pb-3">
<kendo-formfield>
<kendo-label for="myField" text="My Field*"></kendo-label>
<input
kendoTextBox
formControlName="my_field"
type="text"
id="myField"
qa-target="user-my-field-input" />
<kendo-formerror>My field is required</kendo-formerror>
</kendo-formfield>