Struggling with the following.
See the extract of the HTML, the ID is present but it keeps returning a null expression. Unfortunately I cant give any more details on the website... Anything obvious to what I'm doing wrong?
--- Extract of HTML ----
<input name="ctl00$mainCopy$LoginView$LoginControl$UserName" type="text" id="ctl00_mainCopy_LoginView_LoginControl_UserName" tabindex="1" class="txtBox" onchange="document.getElementById('ctl00_mainCopy_LoginView_LoginControl_PasswordResetLink').disabled
= false;" style="width:150px;" />
--- Script ---
$ie = New-Object -com internetexplorer.application
$ie.visible = $true
$ie.navigate("excluded for security")
$ie.document.getElementByID("ctl00_mainCopy_LoginView_LoginControl_UserName").Value= "excluded for security"
---- Error ----
You cannot call a method on a null-valued expression.
At line:1 char:1
+ $ie.document.getElementByID("ctl00_mainCopy_LoginView_LoginControl_UserName").Va ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull