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

Windows 10 PowerShel/Internet Explorer Automation Problem

$
0
0

Hello,

I have a PowerShell script that I use to automate an Internet Explorer window. Basically the code does this:

$ie = New-Object -com InternetExplorer.Application

$ie.navigate('https://www.somewebsite.aspx')

Start-Sleep -Seconds 60  # My code checks for Busy and ReadyState, but this will suffice

$someField = $ie.document.getElementById('theNameOfTheField')

if ($someField -eq $null)
{
     Write-Output 'Some field was not found'
}

I'm passing the name of the field and not the ID. In Windows 7 this works just fine and the field is found. In Window 10, the field is not found.

According to the online documentation (https://msdn.microsoft.com/en-us/library/ms536437%28v=vs.85%29.aspx), the getElementById field will match on the ID or NAME attribute.

In Windows 10 this is not happening. If I use the ID, the element is found with no problems.

The other problem is that Windows 10 doesn't return a null when it fails (as the documentation states it should). It returns an object of the type System.DBNull.

Thanks,

Steve :)






Viewing all articles
Browse latest Browse all 21975

Latest Images

Trending Articles



Latest Images

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