$ie.document method is not visible for console page in powershell

0

I am using powershell to automate login page but when i navigate to login console page there is no $ie.document method is visible. and showing the null error. Method present for console page are :

CreateObjRef Equals
GetHashCode
GetLifetimeService
GetType
InitializeLifetimeService
ToString

Code I am using is :-

$ie = New-Object -ComObject 'internetExplorer.Application'
$ie.Visible= $true # Make it visible
While ($ie.Busy -eq $true) {Start-Sleep -Seconds 7;}
$ie.Navigate("https://matlktwlsapp001:16311/ibm/console/")
start-sleep -s 2;
$ie | gm;
$qw = $ie.document.getElementById("overridelink");
$qw.click();

Error:- You cannot call a method on a null-valued expression.

At line:7 char:1
+ $qw = $ie.document.getElementById("overridelink");
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
At line:8 char:1
+ $qw.click();
+ ~~~~~~~~~~~
+ CategoryInfo          : OperationStopped: (:) [], COMException
+ FullyQualifiedErrorId : System.Runtime.InteropServices.COMException

Kindly Help!!

powershell
powershell-2.0
domdocument
getelementbyid
comobject
asked on Stack Overflow Oct 3, 2018 by Mohit Gupta • edited Oct 4, 2018 by Mohit Gupta

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0