14

I have a InternetExplorer.Application

I am creating an automation and one of the pages I opened, opened a dialog that looks like a new tab, but on the same process (I checked it by the task manager >> process tab that the same process just consumes more RAM) and I don't find the document if that dialog application.

Even in the shell.application In the windows it isn't there.

I want help to find it

I thought to do some recursion on the $ie members to find a word that appears there and if it find a path post that path.

Thank you in advance

Dave Sexton
  • 10,768
  • 3
  • 42
  • 56
Asaf Shazar
  • 1,065
  • 1
  • 11
  • 33

2 Answers2

1

It sounds like the dialog box is a form within the same IE instance. It would be a document element.

$ie.document.documentelement.all | foreach {$DE = $_ ; $DE | where {$_.innerhtml -match "My search arguement"}| foreach{$DE|select uniqueID}}

Once you identify the uniqueID then you can use $ie.Document.getElementById('ms__id14')

0

It's a long shot but since it is in a company intranet, many times is can be a dialog telling you that you have SSL Certificate Error. It may be visible or not based on (wrongly?) enforced policies on your machine by the company. You might try to bypass it using this after navigating to the problematic URL:

    if ($ie.document.url -Match "invalidcert") {
        $bypass_link = $ie.Document.getElementsByTagName("a") | where-object {$_.id -eq "overridelink"}
        $bypass_link.click()
        while ($ie.ReadyState -ne 4) {
            start-sleep -m 100
        }
        "Done!"
    };
It-Z
  • 1,961
  • 1
  • 23
  • 33