Insert integer value and trigger change

@ulrich @Plankton
Hi guys.

In our Angular project we have input field created as FormControl where we also create validation for accepting only digits (RegExp(’^[0-9]+$’)), in that field, we have method for detecting changes (standard Angular onChange() method)
image

I need to trigger onChange(), when input is set by Selenium/UI.Vision. The problem is when I try to insert value to input with “type” or “sendKeys” (or XType)… inserted value is set in field, but onChange() method is not triggered.

image

My opinion is that I have to insert value as Integer, but I don’t know how.
Another solution is double click to input (or Ctrl + A for select text), then Ctrl + C and Ctrl + V.

When I try to copy and paste value from/to input, onChange() method is triggered, but I don’t know how to select all text from input field (i tried XClick - doubleclick, ClickAt, Click, XType with Ctrl + A…)

Row with XType | ${KEY_CTRL+KEY_A} selects all text on the page, but I need select text just in the input (then I will call copy/paste)

Thank you for the help.

It’s more simple to solve

You must use Xtype and write the content (not paste and copy from clipboard)

Xtype simulate keyboard and will be activate onchange command in field like a human typing.

Alternative solution with copy and paste content is after you pasted content add with Xtype a space and remove it (this activate onchange command in field).

When Xtype write in the field activate onchange command automatically like human typing.

1 Like