1

Title is my best guess at the problem. Here is what is happening:

I need to download several thousand files from a very old system (Cogon, in case anyone is interested). For several reasons, the only way to get the data I need, is to click through the system (which works fine), request an archive, limit the "from" and "to" dates to one single day (dialogue shown in the screenshot), click on "Ok", and then download the selected data.

When I perform the sequence manualy, everything works fine. However, when I use Power Automate Desktop, I can populate the fields just fine in several ways (explained below), but if I click on "Ok", the system acts as if I made no inputs.

Does anyone have an idea what might be happening, and how to solve this problem?

Here is the dialogue I am having trouble with:

Dialogue field

This is the code of the input field for the "from" day (hence the value 25)

<div style="width:100%;height:100%;overflow:hidden;">
<table class="Common-CellPadding0 Common-CellSpacing0 DateTimePicker-Layout" dir="LTR">
<tbody><tr>
<td class="nobr Common-AlignCenter Common-VAlignMiddle">
<input 
id="VWG10845_1" type="text" data-vwgeditable="1" value="25"
class="Common-FontData DateTimePicker-InputValue_eq"
style=
"width:13px;display:block;margin:0px;padding:0px;
clear:both;position:static;text-align:center;text-shadow:inherit;"
onfocus="mobjApp.DateTimePicker_OnFocus('10845','1',this,window);"
data-vwgposition="1"
onkeydown="mobjApp.DateTimePicker_OnKeyDown('10845',this,window,event);"
onblur="mobjApp.DateTimePicker_OnTokenBlur('10845','1',this,window);"
onclick="mobjApp.DateTimePicker_OnClick(window,this,'10845','1');"
onmouseup="mobjApp.DateTimePicker_OnMouseup(event);"
tabindex="-1" data-vwgfocuselement="1">
</td></tr></tbody>
</table></div>

What I tried so far:

  • Sending numbers as keyboard commands
  • Sending numbers as keyboard commands as emulated strokes
  • Sending only Up/Down commands
  • Using JS code to set the value of the fields

Here is the JS code I am using to set the values:

function ExecuteScript()
{
document.querySelectorAll('input[id ^=VWG][id $=_1][class="Common-FontData DateTimePicker-InputValue_eq"]')[0].value=%Tag%;
document.querySelectorAll('input[id ^=VWG][id $=_3][class="Common-FontData DateTimePicker-InputValue_eq"]')[0].value=%Monat%;
document.querySelectorAll('input[id ^=VWG][id $=_5][class="Common-FontData DateTimePicker-InputValue_eq"]')[0].value=%Jahr%;
document.querySelectorAll('input[id ^=VWG][id $=_1][class="Common-FontData DateTimePicker-InputValue_eq"]')[1].value=%Tag%;
document.querySelectorAll('input[id ^=VWG][id $=_3][class="Common-FontData DateTimePicker-InputValue_eq"]')[1].value=%Monat%;
document.querySelectorAll('input[id ^=VWG][id $=_5][class="Common-FontData DateTimePicker-InputValue_eq"]')[1].value=%Jahr%;
}

The selector is done this way because the ID changes every time the dialogue is created. Setting the value of the field works just fine, visually at least. But when I focus the field and, e.g., press "Down", the day is set to 24, no matter what value I set before.

Could this be, because there is some magic in the JS functions that makes them talk to the backend? And I am somehow not triggering it, even though I am simulating physical button presses?

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.