I'm trying to click on the login button for the page in the below file / url.
For some reason my code doesn't work. I've been messing with it for a day now. I'm kind of new to powershell so I'm not sure if this is something that's not capable, or if I'm missing something, but this is the latest code.
$username = username
$password = password
$ie = New-Object -com InternetExplorer.Application
$ie.visible=$true
$ie.navigate("192.168.1.10/designs/imm/index.php")
while( $ie.busy){Start-Sleep 10}
$secLink = $ie.Document.getElementsByTagName('A') | Where-Object {$_.innerText -eq 'Continue to this website (not recommended).'}
$secLink.click()
while( $ie.busy){Start-Sleep 10}
while($ie.ReadyState -ne 4) {start-sleep -m 20}
$ie.Document.IHTMLDocument3_getElementById("user").value = $username
$ie.Document.IHTMLDocument3_getElementById("password").value = $password
$link = $ie.Document.IHTMLDocument3_getElementsByName("Login").click
$link.click
I also just downloaded IMacros free trial to see how it's responding. I captured the below
element = driver.findElement(By.id("btnLogin_label"));
element.click();
element = driver.findElement(By.class("dijitOffScreen"));
element.click();
I even tried the below code after seeing that and still got nothing.
$link = $ie.Document.IHTMLDocument3_getElementById('btnLogin_Label') | Where-Object {$_.class -eq 'dijitOffScreen'}
$link.click
If I switch it to the below I get a "overload definitions void click()"
$link = $ie.Document.IHTMLDocument3_getElementById('btnLogin_Label')
$link.click