Powershell ISE WASP/Scipt Freezes on IE Forms Dialog Window Opens - Does not execute further script

Dec 30, 2016 at 10:39 AM
Good day,

I am using Powershell ISE with WASP commands to login to Website click on upload, the code works and i click upload to select file the script freezes on IE Dialog winodw to select file

$ie.Document.getElementByID("form:filesField:files:file").Click() #Upload Button and Dialog PopsUp
Select-Window -Class 'Modal' | Set-WindowActive | Send-Keys 'C:\Temp\20161215.csv~'

The script does not get to the second line of code as its unable to set focus but when i run the second line in another powershell_ise window while dialog is open then it sets focus and works so i tried running another powershell_ise Before or After i click the ShowDialog before it freezes.

Invoke-Expression "C:\Temp\test.ps1"

File test.ps1:

Start-Sleep -Seconds 15
Import-Module WASP -Force
Add-PSSnapin WASP
Select-Window -Class 'Modal' | Set-WindowActive | Send-Keys 'C:\Temp\20161215.csv~'

But before or after does not work or execute as its still freezes, I have read there are issues with the web form needing an action but i dont know how to bypass or a on click event or something - please im kind of depserate as i this is my only stumb ling block
Any help please