Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2018
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.93 KB | None | 0 0
  1. The property 'value' cannot be found on this object. Verify that the property exists and can be set.
  2. At C:Test.ps1:17 char:1
  3. + $usernamefield.value = $username
  4. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  5. + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  6. + FullyQualifiedErrorId : PropertyAssignmentException
  7.  
  8. The property 'value' cannot be found on this object. Verify that the property exists and can be set.
  9. At C:Test.ps1:20 char:1
  10. + $passwordfield.value = $password
  11. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  12. + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  13. + FullyQualifiedErrorId : PropertyAssignmentException
  14.  
  15. Method invocation failed because [System.DBNull] does not contain a method named 'click'.
  16. At C:Test.ps1:23 char:1
  17. + $Link.click()
  18. + ~~~~~~~~~~~~~
  19. + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  20. + FullyQualifiedErrorId : MethodNotFound`
  21.  
  22. $ie = New-Object -ComObject 'internetExplorer.Application'
  23. $ie.Visible= $true # Make it visible
  24.  
  25. $usernmae="test"
  26.  
  27. $password="test1"
  28.  
  29. $ie.Navigate("https://website.com/login")
  30.  
  31. While ($ie.Busy -eq $true) {Start-Sleep -Seconds 3;}
  32.  
  33. $usernamefield = $ie.document.getElementByID('ysi_email')
  34. $usernamefield.value = $username
  35.  
  36. $passwordfield = $ie.document.getElementByID('ysi_password')
  37. $passwordfield.value = $password
  38.  
  39. $Link = $ie.document.getElementByID('ysi_btn_login')
  40. $Link.click()
  41.  
  42. $ie = New-Object -ComObject 'internetExplorer.Application'
  43. $ie.Visible= $true # Make it visible
  44.  
  45. $username="test@toto.fr"
  46.  
  47. $password="test1"
  48.  
  49. $ie.Navigate("https://To your detailled URL")
  50.  
  51. While ($ie.Busy -eq $true) {Start-Sleep -Seconds 3;}
  52.  
  53. $usernamefield = $ie.document.getElementByID('ysi_email')
  54. $usernamefield.value = "$username"
  55.  
  56. $passwordfield = $ie.document.getElementByID('ysi_password')
  57. $passwordfield.value = "$password"
  58.  
  59. $Link = $ie.document.getElementByID('ysi_btn_login')
  60. $Link.click()
  61.  
  62. $ie.Quit()
  63.  
  64. #Load Selenium to download all URL xml sites
  65. Add-Type -Path "C:TempWebDriver.dll" # Load the Selenium .Net library
  66. $env:PATH += ";C:TempUMF_Scraping" # Load the IEDriverServer.exe
  67. $ie_object = New-Object "OpenQA.Selenium.IE.InternetExplorerDriver" # Instantiate Internet Explorer
  68.  
  69. # Using Element ID for this example, but I prefer using The Name element.
  70. $ie_object.Navigate().GoToURL( "https://website.com/login") # Navigate to login page URL
  71. $InputUser = $ie_object.FindElementById("ysi_email") # Find the ID element for username input textbox, gt this from the DOM developer Tools search
  72. $InputUser.SendKeys("usernamegoeshere") # Push the text
  73. $PasswordUser = $ie_object.FindElementById("ysi_password") # Find the ID element for password input textbox, get this from the DOM developer Tools search
  74. $PasswordUser.SendKeys("passwordgoeshere") # Push the text
  75. $LoginButton = $ie_object.FindElementById("ysi_btn_login") # Find the ID element for the submit button, get this from the DOM developer Tools search
  76. $LoginButton.Click() #Sent click to the submit button
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement