Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. $ie = New-Object -ComObject "InternetExplorer.Application"
  2. $ie.navigate("http://example.local")
  3. while($ie.ReadyState -ne 4) { Start-Sleep -Seconds 5 }
  4. $ie.visible = $true
  5. $doc = $ie.document
  6.  
  7. $userField = $doc.getElementById("uid")
  8. $passwordField = $doc.getElementById("pwd")
  9. $submitButton = $doc.getElementById("submit")
  10.  
  11. $userField.value = "userid"
  12. $passwordField.value = "*****"
  13. $submitButton.click()
  14.  
  15. $shell = New-object -ComObject "Shell.Application"
  16. # The app opens a new window with a timestamp - that's the window I want, so I skip the other window
  17. $ie2 = $shell.Windows() | where {$_.Type -eq "HTML Document" -and $_.LocationName -ne "My App - Parent Window"}
  18. $doc2 = $ie2.document
  19. $frames = @($doc2.getElementsByTagName("FRAME"))
  20. Write-Host $frames.Count # shows "3"
  21. Write-Host $frames[1].Title # shows "Left Nav"
  22.  
  23. <frameset rows="60,*">
  24. <frame src="http://example.local/really/long?url" title="Top Nav" name="Top" id="Top">
  25. <frameset cols="175,*">
  26. <frame src="http://example.local/left.html" title="Left Nav" name="Left" id="Left">
  27. <frame src="http://example.local/main.html" title="Main Display" name="Main" id="Main">
  28. </frameset>
  29. </frameset>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement