Jump to content

Recommended Posts

HI,
 
I cannot work out how to connect to the input box on this link:
 
 
My usual method is in my code but it does not seem to find the elements I need to connect with. I can see that "text" and "password" are on the page but im confused about putting input to it.
 
Can someone point me in the right direction?
 
 
 
 
Kind Regards
Dave
#include <IE.au3>
#include <MsgBoxConstants.au3>


$PACE = _IEAttach("https://cms.bskyb.2wire.com/manage/login", "url")
  If @error Then
      MsgBox($MB_SYSTEMMODAL, "Error", "PACE not attached")
      $PACE =_IECreate("https://cms.bskyb.2wire.com/manage/login")
   EndIf




    $colForms = _IEFormGetCollection ($PACE )
For $oForm In $colForms
    $colElements = _IETagNameAllGetCollection ( $oForm )
    For $oElement In $colElements
        If StringInStr ( $oElement.getAttribute ( "tkPid", 2 ), "PID19" ) <> 0 Then
           MsgBox(0, "Result", "Success")
            _IEFormElementSetValue($oElement, "username")
;~             _IEAction ( $oElement, "click" )
         Else
         EndIf

         If StringInStr ( $oElement.getAttribute ( "__eventBits=", 2 ), "7409" ) <> 0 Then
           MsgBox(0, "Result", "Success")
            _IEFormElementSetValue($oElement, "password")
;~          _IEAction ( $oElement, "click" )
         Else
         EndIf
    Next
Next




   Local $oInputs = _IETagNameGetCollection($PACE, "input")
Local $sTxt = ""
For $oInput In $oInputs

    $sTxt &= $oInput.type & @CRLF
    if $oInput.type = "text" Then
   EndIf
Next
MsgBox($MB_SYSTEMMODAL, "Form Inqput Type", "Form: " & $oInput.form.name & @CRLF & @CRLF & "         Types :" & @CRLF & $sTxt)
 
 
Link to comment
Share on other sites

$username_input = $oIe.document.getElementsByClassName('v-textfield').item(0) ;ie 8++
$password_input = $oIe.document.getElementsByClassName('v-textfield').item(1)
;some error checking here

$username_input.value = 'user'
$password_input.value = 'pass'

Dont use that syntax in comparing: $oInput.type = "text". This will True If $oInput.type = 0. Use String($oInput.type) = 'test' ...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...