मैं एक वेबसाइट के अंदर एक लिंक का परीक्षण कर रहा हूं। लिंक एक विंडो को पॉप अप करेगा। एक बार ऐसा होने पर स्क्रिप्ट प्रतिक्रिया नहीं देगी - यह ठंड नहीं है, लेकिन प्रतिक्रिया नहीं देगी। यह किसी चीज़ का इंतज़ार करने जैसा है!
DealerPortalInternetSite = "Website"
$ie = New-Object -ComObject InternetExplorer.Application
$ie.visible=$true
$ie.Navigate($DealerPortalInternetSite)
while($ie.busy -or $ie.ReadyState -ne 4) {
start-sleep 1
}
$ie.document.IHTMLDocument3_getElementById("txtUserID").value = "Username"
$ie.document.IHTMLDocument3_getElementById("txtPassword").value ="Passwor"
while($ie.busy -or $ie.ReadyState -ne 4) {
start-sleep 1
}
$ie.Document.IHTMLDocument3_getElementById("btnLogin").click()
while($ie.busy -or $ie.ReadyState -ne 4) {
start-sleep 1
}
if ($ie.LocationURL -eq "https://portal.toyotafinance.com.au/DealerPortal/UIFrameset.asp?ContactType=106"){
Write-Host "Log in to Dealer Portal is successful `n" -ForegroundColor Cyan
} else {
Write-Host "Log in to Dealer Portal has failed `n" -ForegroundColor Red
}
while($ie.busy -or $ie.ReadyState -ne 4) {
start-sleep -Seconds 1
}
$fs2 = $ie.Document.IHTMLDocument3_getElementById("fs2")
$menuFrame = $fs2.document.IHTMLDocument3_getElementById("oMenuFrame")
$bos01 = $menuFrame.contentWindow.document.IHTMLDocument3_getElementById("bos01")
$bosLink = $bos01.getElementsByTagName("a").item()
$e = $bosLink.click()
मैं पॉपअप विंडो कैसे बंद कर सकता हूं और मूल विंडो पर वापस आ सकता हूं और स्क्रिप्ट जारी रख सकता हूं।