Jump to content

Recommended Posts

bird42

Hello all,

i need a script to complete surveys for me... something like this:

open firefox

go to specified URL

wait till loaded

fill forms

submit

wait till loaded

check new URL

repeat

Could someone please suggest me the best way to do this?

Share this post


Link to post
Share on other sites
JLogan3o13

Must it be Firefox? If so, look at the FF UDF in the Examples forum. If you want to do with IE you can look at the IE functions built into AutoIt.

An example of the form, or the URL you're going to, would go a long way to helping us help you :)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
bird42

i love this forum 'cause it is full of kind helpful peoples :) thank you!

Well, it does not have to be firefox... I tried both, but i always get messy code :(

I'll try to get an html example. Anyway there are textboxes, radio buttons, drop down menus and checkboxes usually.

Share this post


Link to post
Share on other sites
JLogan3o13

Depending on the type of form, and whether the fields are "visible" in the html or hidden inside a bunch of javascript, it is usually easier to use the IE functions, in my own experience. Post what you can find, and we'll do what we can to help ;)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
jdelaney

You could also simply use a custom URL to dynamically populate the form. It depends on how the form is built but in many cases you can do that.

Along these lines, sometimes you can use something like 'curl' to post without requiring a browser at all.

Example: You can start a job in Jenkins via curl (same as logging in, and clicking the build button on a job).

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
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

  • Similar Content

    • rcmaehl
      By rcmaehl
      A UDF to connect and control a Cisco Finesse on the Local Network via it's provided HTTP API
       
      Current Features:
      Lightweight
      * Control over an agent's own login and Status  
      PLANNED Features:
      Heavyweight
      * Large feature set, containing most HTTP API functions
      * Control over own Status as well as Supervisor functionality
        Helpful Premade Examples Files
      * Examples for almost every function
      * Premade CUI and GUI clients showing 
        Ready for all users, beginner and up
      * Detailed Error Reporting to help pin-point problems
      * Thorough parameter checking to prevent accidental script crashes
    • boomingranny
      By boomingranny
      ;****************************************************************** ;Spotify Automation: Start spotify and play a playlist ;v1.01 27/04/2018 ;------------------------------------------------------------------ ;by Daniel Barnes ;------------------------------------------------------------------ ;v1.01 27/04/2018 ;restarts spotify if it fails the first time ;works on computers that minimize Spotify to tray ;instead of closing it, and have a different ui element selected ;such as the Devices available option when spotify is started ;------------------------------------------------------------------ ;v1.00 25/04/2018 ;initial version ;------------------------------------------------------------------ ;Replace the below with the Spotify URI ;If you right click the playlist> share> copy spotify uri ;you can find the uri $spotifyURI = "spotify:user:12177300374:playlist:0iaTAvHRSaIkD23ofl2tck" ;****************************************************************** ;if this script breaks in the future, figure this out using the AutoIt Window Info Tool Const $SpotifyWindowIdentifier = "[Title:Spotify;Class:Chrome_WidgetWin_0]" ;NOTE ABOUT SHUFFLE: ;I couldn't automate turning shuffling on or off ;I can toggle it, but I cannot figure out the current state ;If you want to shuffle, turn on shuffle in Spotify prior ;to running this script PlaySpotifyPlaylist($spotifyURI) Func PlaySpotifyPlaylist($spotifyURI,$retry = 0) ;terminate spotify process on subsequent attempts If $retry Then echo ("Closing existing Spotify process") ProcessClose("Spotify.exe") endif echo ("Launching Spotify URI") ShellExecute($spotifyURI) ;Pause any existing song playing (if there is any) ;this is because Spotify's window title is only 'Spotify' when it is not playing any songs If Not WinExists($SpotifyWindowIdentifier) Then echo ("Pausing existing song (To find spotify window)") $timer = TimerInit() While Not WinExists($SpotifyWindowIdentifier) Send("{MEDIA_PLAY_PAUSE}") Sleep(500) If TimerDiff($timer) > 5 * 1000 Then ErrorMsg ("Timed out trying pause existing song") WEnd endif ;Get Spotify Window Handle $hwndSpotify = WinGetHandle($SpotifyWindowIdentifier) echo ("Attempting to play playlist") $timer = TimerInit() While WinGetTitle($hwndSpotify) = "Spotify" ;once it is playing the song, the title changes to the name of the song WinActivate($hwndSpotify) ControlSend($hwndSpotify,"","","{ENTER}") ;space will play what was previously playing (even another playlist or song), enter will play the playlist ;) Sleep(1000) If TimerDiff($timer) > 5 * 1000 Then If $retry Then ErrorMsg ("Timed out trying to play playlist") else Return PlaySpotifyPlaylist($spotifyURI,$retry+1) endif endif WEnd EndFunc Func echo($text) ConsoleWrite ($text&@CRLF) EndFunc Func ErrorMsg($text) MsgBox(16,StringTrimRight(@ScriptName,4),$text) Exit EndFunc  
    • TheSaint
      By TheSaint
      TeraCopy Timer - A program of mine, front end really, that I have been working on (on & off) for some time, but not shared here before, that I recall. Third party program TeraCopy is required.
      Many of you will be familiar with TeraCopy, and it has been discussed here at AF on several occasions, in various sub forums, including Chat.
      BE ADVISED - I still use an older version of TeraCopy (v2.27), a goody but an oldy, so have only tested my program with that. It may work with the newer v3.xx, or may be easily adjusted to do so, but I have not yet gone that route. Likewise, I only use it with Win 7 and Win XP, but I don't imagine there should be any issues with newer Windows. Add to that, my program being devised and created in AutoIt v3.3.0.0.
      So what is TeraCopy Timer and why might you need it?
      --------------------------------------------------------------------------------------
      Those familiar with TeraCopy use, know you can run multiple copy or move jobs either simultaneously or concurrently (one immediately after another has finished). With the free version at least, you have no control over precise order or timing, and no way to deal (without manual interaction) with the pesky Thumbs.db files in Win XP. TeraCopy Timer allows you to do all those things, and in a batch fashion.
      --------------------------------------------------------------------------------------
      Some screenshots and brief explanation
      Main Window
      Minimalist Window
      This new WAIT feature is the simplest and best way to use the program generally (in my view) ... but check out the following, as it is not always the case.
      Advanced Delay Window
      WARNING - It should go without saying, that you take all the usual precautions. For instance, don't use move with the only copy you have of precious files. BACKUP BACKUP BACKUP! Don't hold me liable for anything, except for being a nice guy who likes to share.
      TeraCopy Timer v2.8.zip  (see detail at Post #34)
      Enjoy!
      OLDER DOWNLOADS
      P.S. I am not affiliated in any way with those who created and provide the excellent third party program - TeraCopy.
    • ur
      By ur
      I have an aws cloud machine where I kept all the build process to create some set of zip files and uploading them to OneDrive.
      Once it is completed, I have another local machine in our environment which is a acting as a local share server also.
      Is there anyway to notify this machine(without public IP) to start downloading these files.
      I have written an AutoIT exe to download these files and copy them to respective locations.But don't know how to notify this from the remote machine.
       
      Any suggestion??
       
    • Nareshm
      By Nareshm
      Its Possible To auto Login with autoit script ?
×