I came across this at my last job and never found a great solution. The problem is that when the value changes. You just do it on the DOM, since you found JavaScript, it does not notice the change.
The extremely hacky way I found to get this to work is to send the keys to the element. I have no code in front of me, so I can’t tell you the exact syntax. This works because JavaScript sees it the same way as if the input came from the keyboard buffer and will be updated accordingly.
This is not so bad if it weren’t for the following drawback: the IE page must be visible and active to send keys for work - you cannot just send keys to a COM object. You make the COM object visible, then you select the process, then you can send keys to this window. This is obviously quite fragile and makes it so that the user cannot multitask while the script is running. Hope someone has an even more elegant method. :)
For your example of a drop-down rather than a text field, you probably have to select a field and then send arrays to go to the different values of the drop-down list.
source share