Unable to set text in a field

Hi everyone,

I am new to the Katalon world and I am struggling with an issue.

On the page I am currently working on, I have a field that I simply cannot fill in.
I am able to locate the element and click inside it, but afterwards neither the setText nor the sendKeys actions work. I set a delay but that does not help either.
I am getting back the error: Caused by: org.openqa.selenium.InvalidElementStateException: invalid element state.

Any suggestions?

Thanks in advance.

Can you share the locator you are using in the test object for that element?

What you seem to have there is an aria-defined spinbutton. It’s entirely possible that this control does not accept input in the normal sense – and that may be your problem. But trying to help you here without knowing how that control is meant to work, is almost impossible.

If the control expects keyboard input, try send up/down arrow keys.

I don’t see any up/down (increment/decrement) buttons, but if they’re present when the control gets focus, try clicking those.

Either way, an input with role=spinbutton is a type of range. You can maybe glean more here:

https://w3c.github.io/aria/#spinbutton

In manual testing we usually input data using the copy/ paste feature.

A second option is to use the up/down arrows on the keyboard, but that is taking longer time than preferred.

Thanks

Hi Brandon,

This is the locator I am using.

Try targeting the <input> element instead:

//*[contains(@placeholder, 'Replaced SN')]//input[@role='spinbutton']

In the attached screenshot, I found 2 names “Replaced SN” and "Replaced SP field — a typo here: ‘SN’ or ‘SP’?

Hi Brandon,

Yes, that was the solution. I had to change the test object’s xpath and now everything looks to be fine.

Thanks for your support.