Insert data into another property of the object

It happened that when setting the date it was not saved in the object, reviewing I see that the date is saved in the gxoldvalue property, how can I insert the date in this property? Thank you

WebUI.waitForElementClickable(findTestObject(‘Prueba Alta Persona/Pagina_Alta/input_Fecha Nac_SDTVAR_SDTPERSONA_KLIFECNAC’),
15)

WebUI.modifyObjectProperty(findTestObject(‘Prueba Alta Persona/Pagina_Alta/input_Fecha Nac_SDTVAR_SDTPERSONA_KLIFECNAC’),
‘value’, ‘’, ‘24/10/1985’, false)

WebUI.setText(gxoldvalue, ‘24/10/1985’)

Off-Topic, highly opinionated comment: That’s a GeneXus control, I believe. A system designed to provide code as well written as a developer (so they claim). No good developer would mess around with onblur inside an onchange handler (or the reverse) and then call yet another onchange handler. That’s just terrible and tells me everything I need to know about this library/company.

Your problem is likely caused by that mess I mentioned above. To help you, I went to the GeneXus site to dig out the correct API to apply a value from code. In a reasonable amount of time (a little more than I intended) I failed to find the API docs. All I got was marketing noise and other bullshit. If you know where they are, post a link, please.

So, we’ll need to try some experiments. This might not be quick. Maybe we will find a solution on the first attempt, maybe not.

So, experiment 1:

What happens when you paste this into the DevTools console?

document.querySelector("input[name=SDTVAR_SDTPERSONA_KLIFECNAC]").value="24/10/1985"

In your response, post a screenshot of the browser with the page loaded and make sure the DevTools are visible.

Thank you very much for your time and for helping me. I did the test that you asked me attached screenshot

You should probably test the datepicker control itself, but this Groovy/JavaScript will repeat what you just did in the console but from a Test Case:

String js = 'document.querySelector("input[name=SDTVAR_SDTPERSONA_KLIFECNAC]").value="24/10/1985";'
WebUI.executeJavaScript(js, null)

Thank you very much with your help solve the problem!

1 Like

Please post your question as a NEW TOPIC and provide as much information as possible: