Jump to content

How to fill web form in firefox?


Go to solution Solved by Danp2,

Recommended Posts

i want fill an web form automatically by running autoit script.

#include <D:\My_Files\Automation scripts\FF-mozilla\FF.au3>
#include <GuiButton.au3>
#include <File.au3>
#include <_FF_AutoLogin.au3>
 
;Variable Declaration
Dim $url, $formID, $formUID, $uName, $formPID, $pwd, $formSubmit
 
 
$url = "file:///C:/Users/m1024193/Desktop/HTML.html"
$formID = ""
$formUID = "username"
$uName = "admin"
$formPID = "passwordt"
$pwd = "Seven"
$formSubmit = "ID_LOGON"
 
_FFStart($url)
If _FFConnect() Then
 
 _FF_AutoLogin("srv.iloadmin","SeR^ER@iL0", "file:///C:/Users/m1024193/Desktop/HTML.html")
  
EndIf

i have tried above code

Edited by chandana
Added code tags
Link to comment
Share on other sites

  • Moderators

chandana,

For the second time:

As well as using code tags, post in the correct section of the forum. Once more I have moved the thread for you - I do not want to do it again. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

i want fill an web form automatically by running autoit script.

#include <D:\My_Files\Automation scripts\FF-mozilla\FF.au3>
#include <GuiButton.au3>
#include <File.au3>
#include <_FF_AutoLogin.au3>
 
;Variable Declaration
Dim $url, $formID, $formUID, $uName, $formPID, $pwd, $formSubmit
 

 
$url = "file:///C:/Users/m1024193/Desktop/HTML.html"
$formID = ""
$formUID = "username"
$uName = "admin"
$formPID = "passwordt"
$pwd = "Seven"
$formSubmit = "ID_LOGON"
 
_FFStart($url)
If _FFConnect() Then

 _FF_AutoLogin("srv.iloadmin","SeR^ER@iL0", "file:///C:/Users/m1024193/Desktop/HTML.html")
   
EndIf
i have tried above code

 

it is not filling username and password details automatically

Edited by chandana
Link to comment
Share on other sites

>"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "D:\My_Files\Automation scripts\FF-mozilla\11.au3"    
__FFStartProcess ==> General Error: Error reading registry entry for FireFox.
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mozilla\Mozilla Firefox\*CurrentVersion*\Main\PathToExe
Error from RegRead: 1
_FFConnect: OS: WIN_7 WIN32_NT 7601 Service Pack 1
_FFConnect: AutoIt: 3.3.10.2
_FFConnect: FF.au3: 0.6.0.1b-10
_FFConnect: IP: 127.0.0.1
_FFConnect: Port: 4242
_FFConnect: Delay:  2ms
_FFConnect: Socket:  568
_FFConnect: Browser: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0
__FFSendJavaScripts: Sending functions to FireFox .......... done
_FFLoadWait: . loaded in 10ms
[object XrayWrapper [object HTMLDocument]] - {location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, write: function() {...}, writeln: function() {...}, ...}
_FFConnect: OS: WIN_7 WIN32_NT 7601 Service Pack 1
_FFConnect: AutoIt: 3.3.10.2
_FFConnect: FF.au3: 0.6.0.1b-10
_FFConnect: IP: 127.0.0.1
_FFConnect: Port: 4242
_FFConnect: Delay:  2ms
_FFConnect: Socket:  576
_FFConnect: Browser: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0
__FFSendJavaScripts: Sending functions to FireFox .......... done
_FFOpenURL: file:///C:/Users/m1024193/Desktop/HTML.html
__FFSend: try{window.content.top.document.location.href='file:///C:/Users/m1024193/Desktop/HTML.html'}catch(e){'_FFCmd_Err';};
__FFRecv: file:///C:/Users/m1024193/Desktop/HTML.html
_FFLoadWait: .. loaded in 270ms
[object XrayWrapper [object HTMLDocument]] - {location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, write: function() {...}, writeln: function() {...}, ...}
__FFSend: FFau3.WCD=window.content.top.document;
__FFRecv: [object XrayWrapper [object HTMLDocument]] - {location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, write: function() {...}, writeln: function() {...}, ...}
[object XrayWrapper [object HTMLDocument]] - {location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, write: function() {...}, writeln: function() {...}, ...}
__FFSend: try{window.content.top.document.forms.length}catch(e){'_FFCmd_Err';};
__FFRecv: 0
__FFSend: FFau3.xpath=null;try{FFau3.xpath=FFau3.WCD.evaluate("count(//form[1]//input[@type='password'])",FFau3.WCD,null,XPathResult.NUMBER_TYPE,null).numberValue;}catch(e){'_FFXPath_Error: '+e;};
__FFRecv: 0
>Exit code: 0    Time: 3.121

i am getting this error..

Link to comment
Share on other sites

  • Solution

There are still some minor issues with you code. Here's my revised version:

#include <FF.au3>
#include <_FF_AutoLogin.au3>

;Variable Declaration
Dim $url, $formID, $formUID, $uName, $formPID, $pwd, $formSubmit

$url = "file:///C:/Users/m1024193/Desktop/HTML.html"
$formID = ""
$formUID = "username"
$uName = "admin"
$formPID = "passwordt"
$pwd = "Seven"
$formSubmit = "ID_LOGON"

_FFStart($url)

If _FFIsConnected() Then
    _FF_AutoLogin("srv.iloadmin","SeR^ER@iL0")
EndIf

I don't see any errors in the Scite output. However, it looks like there aren't any forms on this web page so it doesn't appear that _FF_AutoLogin will work properly in this instance.

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...