title: searching a string using powershell i a web page
body: <p>I need to validate the username and password of this site. When I type invalid password it should check the page for string 'invalid email'. The message fail to login should be displayed. But 'success' is being displayed.? What is the mistake?</p>
  
  <pre><code>$url = "https://www.jabong.com/customer/account/login/" 
  $cred = Get-Credential #Read credentials
  $username = $cred.username
  $username = $username.Replace("\", "")
  $password = $cred.GetNetworkCredential().password
  $ie = New-Object -com internetexplorer.application; 
  $ie.visible = $true; 
  $ie.navigate($url); 
  while ($ie.Busy -eq $true) 
  { 
  Start-Sleep 1; 
  
  } 
  $ie.Document.getElementById("LoginForm_email").value = $username
  $ie.Document.getElementByID("LoginForm_password").value=$password
  $ie.Document.getElementByID("qa-login-button").Click();
  while($ie.busy) {sleep 1}
  $webClient = new-object System.Net.WebClient
  $webClient.Headers.Add("user-agent", "PowerShell Script")
  $output = $webClient.DownloadString("https://www.jabong.com/customer/account/login/")
  if ($output -like "*Invalid mailid*") {
    "login failed"
  } else {
    "success"
  }
  sleep(300)
  </code></pre>