Website Login Automation and Output STatus

0

I am trying to automate a task to login and verify or not login is success in a nutshell I am able to create.

$username = "XXXX"
$password = "XXXXXXXX"
$ie = New-Object -com InternetExplorer.Application
$ie.visible=$true
$ie.navigate("https://com/login")
while($ie.ReadyState -ne 4) {start-sleep -m 100}
$ie.document.getElementById("user_email").value= "$username"
$ie.document.getElementById("user_password").value = "$password"
$ie.document.getElementById("Loginform").submit()
start-sleep 20
$ie.Document.body

Its throwing error

Exception from HRESULT: 0x800A01B6
+ $ie.document.getElementById("user_email").value= "$username"
At line:8 char:1
+ $ie.document.getElementById("user_password").value = "$password"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], NotSupportedException
    + FullyQualifiedErrorId : System.NotSupportedException

Exception from HRESULT: 0x800A01B6
At line:9 char:1

i can confirm that the HTML id for the login box is user_email and user_password

powershell
asked on Stack Overflow Nov 22, 2019 by Sandeep Raigiri

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0