The title summarizes my hypothesis about the issue I’m facing. Here’s the situation:
I'm tasked with downloading a large number of files from an outdated system called Cogon. Unfortunately, the only viable method to retrieve the data is by manually clicking through the interface. This process involves navigating to a dialogue box, setting specific "from" and "to" dates to a single day, clicking "Ok," and then downloading the data.
When I execute this process manually, it works as expected. However, when attempting to automate the clicks with Power Automate Desktop, I can fill out the fields correctly in various ways. Yet, when I click "Ok," it seems as if no input was entered.
Is there anyone who can suggest what might be going wrong and how I could potentially resolve this issue?
The interface I'm interacting with is shown in the image below:
This is the code snippet for the input field regarding the "from" date:
The strategies I’ve attempted include:
- Sending numeric values via keystrokes
- Emulating keyboard inputs for numeric values
- Utilizing only Up/Down navigational commands
- Employing JavaScript to set the input field values
Here’s the JavaScript code used for setting values:
function RunScript() { document.querySelectorAll('input[id ^=VWG][id $=_1][class="Common-FontData DateTimePicker-InputValue_eq"]')[0].value=%Day%; document.querySelectorAll('input[id ^=VWG][id $=_3][class="Common-FontData DateTimePicker-InputValue_eq"]')[0].value=%Month%; document.querySelectorAll('input[id ^=VWG][id $=_5][class="Common-FontData DateTimePicker-InputValue_eq"]')[0].value=%Year%; document.querySelectorAll('input[id ^=VWG][id $=_1][class="Common-FontData DateTimePicker-InputValue_eq"]')[1].value=%Day%; document.querySelectorAll('input[id ^=VWG][id $=_3][class="Common-FontData DateTimePicker-InputValue_eq"]')[1].value=%Month%; document.querySelectorAll('input[id ^=VWG][id $=_5][class="Common-FontData DateTimePicker-InputValue_eq"]')[1].value=%Year%; }
The selector approach is necessary as the ID varies for each session. While visually the input appears to be set correctly, when I focus on the field and try to adjust the value using the down arrow key, it reverts to 24, regardless of the value set prior.
Could this issue stem from some underlying JavaScript functions that are crucial for backend communication, which I might not be triggering, even when simulating key presses?