Insert Text in Fields on a Web Page

Hi,

For demo purposes I would like to insert text into some fields . But the problem is that the id keeps changing.

So when I add the action Execute a Javascript in Front Browser and insert:

document.getElementById('input-754').value = 'Test'

It's working, but the next time it won't. So how can I dynamically retrieve the id or perhaps there is another way to insert the text into this field. Can anyone help me? See below for the results from the inspect element.

btw. The label name of this field is "Specific Wishes".

See if this works:

document.querySelector('textarea.slds-textarea').value

Thanks for your reply. No it doesn't work.

Is that page public? If so then please post a URL.

No sorry. It's salesforce crm. But I can give you access to a developer environment.

Does any records-record-layout-text-area element have the data-input-element-id="input-field" other than the one shown? If it's unique you can base a query selector on that.

He Vincent,

Yes it does.

I had the same problem with the Freshdesk web app, gave up looking for a scripting way round it, and ended up driving the UI using KM's "Click at..." based on found image for buttons and with an appropriate offset for labels/text fields.

Horribly clunky, but it does work once you get all the appropriate pauses in place.

I've found the solution by focusing on the label text of the field name.

Then you can insert text by typing.

image

1 Like