Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Powershell automate Post of file on Website but unable to close Website popup windows close or ok

$
0
0

Good day, please help

i am trying to automate the uploading of files to a website.

1. requires to login > close popup "welcome message box" close window

2. then select upload link > then select which upload toggle button option > click upload liink > then again OK on "upload message" popu box

i got to the point where i login but i cant seem to get to the close "X" window on "welcome" popup messge window after login

probably going to have the same issue on the popup window when upload

i checked the html source but dont find the "X"button on form as its a form window with no button and i got the script to close the window but it closes all the windows including the main window i want to upload files

Import-Module wasp $url = 'http://page/login.seam' $username = $args[0] $password = $args[1] $ie = New-Object -COM InternetExplorer.Application -Property @{ Visible = $true Navigate = $url } while ($IE.Busy -eq $true) { # System Sleep/Wait Start-Sleep -Seconds 5 # Focus window iexplore $window = Select-UIElement -ProcessName iexplore # Close Alert key stroke $window | Send-UIKeys '{ESCAPE}' } # LOGIN page $ie.Document.textbox $ie.Document.getElementById("j_id:nick").value = "test" $ie.Document.getElementByID("j_id:submit").Click()

## TRYING TO CLOSE THE POPUP WELCOME WINDOW WITH NO BUTTONS BUT A FORM CLOSE $ie.Document.getElementByID("j_id36:j_id40").Click() $ie.Document.getElementByID("j_id36:messagesPanelFirstHref").Click() ## close IE #Get-Process -name iexplore | Foreach-Object { $_.CloseMainWindow() } #$ie.Quit() #[System.Runtime.Interopservices.Marshal]::ReleaseComObject($ie)


Please any help, i would need more help after this as i dont know how choose on option toggle which upload file i want to choose but i want to get past this hurdle first.

Regards


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>