AutoIt actions for Flash controls in the Web

Source: Internet
Author: User

1. For AutoIt environment configuration and installation I will not say much, a search on the internet a lot.

2. I used selenium for the web for automated testing, but selenium for Flash is powerless, I have been looking for a long time on the internet, for selenium must be the flash to re-build to operate through JS, But this is a long time ago method, I do not know whether it is applicable, so it is a good choice to choose AutoIt for simulating manual operation.

3. According to the information I find on the internet to use AutoIt for the direct operation of Firefox, must apply to FF.AU3, for such operations I found online information as follows:

AUTOIT3 itself has built-in user-defined function IE.AU3, limited to IE browser, if it is a Firefox browser requires additional custom functions.

I found a lot of information about a FF.AU3 custom function, http://www.autoitscript.com/forum/topic/95595-ffau3-v0601b-10/

This is a custom function library for Firefox browser, so you can access the Web page via Firefox.

Implementation steps and discovered issues:

1. Download Ff.au3, placed in the script directory, can also be placed in the AUTOIT3 installation directory, such as: C:\Program files\autoit3\include.

2. You need to install a plugin mozrepl on the Firefox browser, https://addons.mozilla.org/en-US/firefox/addon/mozrepl/

Click Direct Download, Firefox will prompt installation, after installation to open, the method is: "Tools", "Mozrepl", "start", each time you open the browser must start, otherwise you can not communicate.

MOZREPL will open a port, default 4242, so that the AutoIt3 script through the Windows API to communicate with the Firefox browser, the operation of the browser for automation.

3. Write a script to copy a piece of code from the online document, ff.au3 the online document address http://english.documentation.ff-au3.thorsten-willert.de/

Copy the first demo run from the online document

#include "Ff.au3"
_ffstart ("http://ff-au3-example.thorsten-willert.de/")

If _ffisconnected () Then
Sleep (2000)
_ffaction ("Presentationmode", True)
Sleep (2000)
_ffopenurl ("http://www.baidu.com")
Sleep (2000)
_ffaction ("Back")
_ffaction ("Presentationmode", False)
Sleep (2000)
_ffopenurl ("Chrome:bookmarks")
Sleep (2000)
_ffaction ("alert", "Bye Bye ...")
_ffquit ()
EndIf

Error found:

! Au3check doesn ' t support input files encoded as UTF8 with BOM:D:\AUTOIT\FF.AU3
"D:\AutoIt\ftest.au3" (3,54): Error: _ffstart (): undefined function.

..........

This problem is because FF.AU3 this file encoding is UTF8 with the BOM, which is the official recommended encoding format, but Au3check do not know why not support, the solution is to add the file header above:

#AutoIt3Wrapper_Run_Au3Check =n.

4. Add the above sentence OK, you can compile without error, but not working properly, view console information, display error message:

__ffstartprocess ==> General Error:error Reading registry entry for FireFox.
Hkey_local_machine\software\mozilla\mozilla Firefox\*currentversion*\main\pathtoexe

4. And I am accustomed to apply selenium, so for the operation of the page vision, with selenium open the Web page, in the use of AutoIt to locate the form, the same can be achieved

Mouse coordinates may need to be adjusted according to the actual situation. This data can be obtained by dragging the Finder tool on the right.

5. Direct use of AutoIt with the editor run will be an error, I do not know what the reason, the application of the tool to edit the EXE to run without problems

6. Other grammars can be viewed on the http://www.jb51.net/shouce/autoit/website.

AutoIt actions for Flash controls in the Web

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.