I have a nice powershell script that automates a particular website for my daughter. Recently they changed the site and added a nice new feature that would speed up my script by a factor of 10. The problem is the input type they use to activate this pops up a confirmation dialog. The HTML looks like this
<input type=submit name='enter_all' value='Enter all' onClick="return confirm('Enter all?');">
Can I automate answering this dialog in powershell? I want the script to run in the background so I think sending keystrokes is out.
Answering my own question but I did find a way to do this even if it is a bit of a hack.
The main script uses Internet Explorer via Com much like
There are lots of examples on how to use the ie com object to navigate, fill in fields, click on buttons, etc, etc. However the pop up confirmation just causes things to hang up.
To get around this I started another thread using Wasp which is a library for automating windows forms. In this thread I just sit in a loop looking for the confirmation prompt and click on it. (The window pops up many times for in my case). The code for this script looks like this