Search code examples
mozillaautoit

Unable to fill values into text box using autoit script with firefox?


i am unable to fill values into text box ?i have tried following code..``

$url = "file:///C:/Users/Desktop/HTML.html"
    $formID = ""
    $formUID = "username"
    $uName = "srv.iloadmin"
    $formPID = "password"
    $pwd = "SeR^ER@iL0"
    $formSubmit = "ID_LOGON" 
    Run(@ProgramFilesDir & "\Mozilla Firefox\firefox.exe " & $url, "", @SW_MAXIMIZE)
    _FFSetValue($uName,$formUID,"id")
    _FFSetValue($pwd,$formPID,"id")

HTML script username is:

<input autocomplete="off" class="textfield" name="username" id="username" size="30" onkeypress="return checkEnter(event);" type="text">

Password:

<input autocomplete="off" class="textfield" name="password" id="password" size="30" onkeypress="return checkEnter(event);" type="password">

Solution

  • You need to take a closer look at Firefox UDF

    Here is a simple example:

    #Include <FF.au3>
    
    _FFConnect()
    If _FFIsConnected() Then
    _FFOpenUrl("http://www.example.com/news/811")
     _FFLoadWait()
    _FFClick(".forms[2].elements[0]")
    _FFLoadWait()
    EndIf