Jump to content

FF.au3 (V0.6.0.1b-10)


Stilgar
 Share

Recommended Posts

Thx for your Help.

You solved my problem.

Trying to show a short version of my code I recognized, that I had formerly commented out a code-line (no idea why o:) )

It was a kind of "First Try"-Line, so the script worked nevertheless properly.

Now I'v corrected it

#include <FF.au3>

OeffneSite()
Main()
EXIT

Func OeffneSite()
;   OeffneSite2()           ; <<<======= accidentally commented out !!! 
    if _FFSearch("Die Verbindung zum Server wurde getrennt.") then 
        _FFQuit()
        ;... some prepearing code
        OeffneSite2()
    endif 
EndFunc

Func OeffneSite2()
  _FFStart() ; Vorabstart damit PROG Zeit hat MozRepl zu erkennen.
  _FFOpenURL("http://www.autoitscript.com")
  ;... some code
EndFunc


Func main()
  ;... lot of code
EndFunc

I just got stuck at the problem due to the Code error in line 2325, (see post #653)

Link to comment
Share on other sites

You need to establish a connect to Firefox / Mozrepl before you can utilize the other _FF* functions. Try adding a call to _FFConnect at the beginning of your script, or you could use something like this:

Func _FFCheckConnection()
Local $result = True

    If Not _FFIsConnected() Then
        If Not _FFConnect(Default, Default, 3000) Then
            $result = False
        EndIf
    EndIf

    Return $result
EndFunc
Link to comment
Share on other sites

  • 1 month later...

Hi

first of thanks for the UDF it is exactly what I need except i can not get it working.

I keep on getting this error in debug window.

I tried the example from the help file as below

 
#Include <FF.au3>

_FFStart("http://ff-au3-example.thorsten-willert.de/")

If _FFIsConnected() Then
    Sleep(2000)
    _FFAction("presentationmode", True)
    Sleep(2000)
    _FFOpenURL("http://www.google.com")
    Sleep(2000)
    _FFAction("back")
    _FFAction("presentationmode", False)
    Sleep(2000)
    _FFOpenURL("chrome:bookmarks")
    Sleep(2000)
    _FFAction("alert", "Bye bye ...")
    _FFQuit()
EndIf
 
 
 

 

+>12:58:22 Starting AutoIt3Wrapper v.14.801.2025.0 SciTE v.3.4.4.0   Keyboard:00000409  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64    Environment(Language:0409)

+>         SciTEDir => C:Program Files (x86)AutoIt3SciTE   UserDir => C:UserskjahantaAppDataLocalAutoIt v3SciTEAutoIt3Wrapper   SCITE_USERHOME => C:UserskjahantaAppDataLocalAutoIt v3SciTE 
>Running AU3Check (3.3.12.0)  from:C:Program Files (x86)AutoIt3  input:C:UserskjahantaDesktopBot!mql5.au3
! Au3check doesn't support input files encoded as UTF8 with BOM: C:\Program Files (x86)\AutoIt3\Include\FF.au3
"C:UserskjahantaDesktopBot!mql5.au3"(3,54) : error: _FFStart(): undefined function.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:UserskjahantaDesktopBot!mql5.au3"(5,19) : error: _FFIsConnected(): undefined function.
If _FFIsConnected()
~~~~~~~~~~~~~~~~~~^
"C:UserskjahantaDesktopBot!mql5.au3"(7,36) : error: _FFAction(): undefined function.
_FFAction("presentationmode", True)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:UserskjahantaDesktopBot!mql5.au3"(9,36) : error: _FFOpenURL(): undefined function.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:UserskjahantaDesktopBot!mql5.au3"(17,10) : error: _FFQuit(): undefined function.
_FFQuit()
~~~~~~~~^
C:UserskjahantaDesktopBot!mql5.au3 - 6 error(s), 0 warning(s)
!>12:58:22 AU3Check ended. Press F4 to jump to next error.rc:2
+>12:58:22 AutoIt3Wrapper Finished.
>Exit code: 2    Time: 0.5737

 

 

Any one had this problem? or know what I am doing wrong? Any help would be much appreciated

Edited by fxprodigy
Link to comment
Share on other sites

fxprodigy,

See >this thread...

Je

much appreciate your answer. I am a newbie in AutoIt and still learning so bear with me plz. I read the thread u mentioned and below is what I found the most relevant. Here is my problem, that did not answer my question or more likely, I did not understand what to do exactly to get this right and working.

ould u plz shed some light on this one. Any help would be greatly appreciated

Ksm

 

listee, on 08 Aug 2014 - 6:17 PM, said:snapback.png

If the primary file encoding is UTF8withBOM, #include UDF file encoding is UTF8 without BOM, everything is OK.

 
The file SHOULD BE encoded as UTF8 with BOM to continue processing by AutoIt3Wrapper.   BUT
 Au3check doesn't support input files encoded as UTF8 with BOM

 

 

This is correct. AU3CHECK does NOT support any UTF encoded files. AutoIt3Wrapper has a workaround for this limitation of au3check, but only for the main script, by copying it to a temp file before processing, But again: this is only for the Main script.

It is what it is until somebody puts the effort in to fix au3check.

Jos

Link to comment
Share on other sites

Open the file ff.au3 in scite and then save it in a different encoding format. I'm not in front of a computer but I believe it's an option under the file menu.

 

Hi

did that, doesn't work. It keeps giving me error message.

2zegsw2.jpg

 

! Au3check doesn't support input files encoded as UTF8 with BOM: C:UserskjahantaDesktopBotFF.au3

"C:UserskjahantaDesktopBot!mql5.au3"(3,54) : error: _FFStart(): undefined function.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:UserskjahantaDesktopBot!mql5.au3"(5,19) : error: _FFIsConnected(): undefined function.
If _FFIsConnected()
~~~~~~~~~~~~~~~~~~^
"C:UserskjahantaDesktopBot!mql5.au3"(7,36) : error: _FFAction(): undefined function.
_FFAction("presentationmode", True)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:UserskjahantaDesktopBot!mql5.au3"(9,36) : error: _FFOpenURL(): undefined function.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:UserskjahantaDesktopBot!mql5.au3"(17,10) : error: _FFQuit(): undefined function.
_FFQuit()
~~~~~~~~^
C:UserskjahantaDesktopBot!mql5.au3 - 6 error(s), 0 warning(s)
!>12:11:54 AU3Check ended. Press F4 to jump to next error.rc:2
+>12:11:54 AutoIt3Wrapper Finished.
>Exit code: 2    Time: 0.5017
 
Link to comment
Share on other sites

Then you aren't doing it correctly.  :sorcerer:

huum I don't believe so As i had this problem with some other codes of main and solved it in a way you described. I will try that on another PC just to make sure I am not doing it wrong. will put the outcome here once i did it. I hope  I am doing something wrong and what you say works

cheers

Link to comment
Share on other sites

Then you aren't doing it correctly.  :sorcerer:

U were right after all. I am not sure what I was doing wrong but I managed to overcome the first issue now I am having trouble with this new one.

When I am trying to run below piece of code (example from FF help file) I get this error regarding registery. Any idea how to troubleshoot this one.

Thanks for your help

#Include <FF.au3>

_FFStart("http://ff-au3-example.thorsten-willert.de/")

If _FFIsConnected() Then
    Sleep(2000)
    _FFAction("presentationmode", True)
    Sleep(2000)
    _FFOpenURL("http://www.google.com")
    Sleep(2000)
    _FFAction("back")
    _FFAction("presentationmode", False)
    Sleep(2000)
    _FFOpenURL("chrome:bookmarks")
    Sleep(2000)
    _FFAction("alert", "Bye bye ...")
    _FFQuit()
EndIf

 

__FFStartProcess ==> General Error: Error reading registry entry for FireFox.

HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMozillaMozilla Firefox*CurrentVersion*MainPathToExe
Error from RegRead: 1
_FFIsConnected ==> Socket Error: -1
+>18:28:08 AutoIt3.exe ended.rc:0
+>18:28:08 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 0.942
 
Link to comment
Share on other sites

On second attempt also I tried to run below code

#Include <FF.au3>

; trying to connect to a running FireFox with MozRepl on
If _FFConnect(Default, Default, 3000) Then
    ; open a page
    _FFOpenURL("http://ff-au3-example.thorsten-willert.de/")
    Sleep(3000)
    ; disconnect from FireFox
    If _FFDisConnect() Then MsgBox(64, "", "Disconnected from FireFox!")
Else
    MsgBox(64, "", "Can't connect to FireFox!")
EndIf
 

when I get this error

 

--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop

_FFConnect: OS: WIN_8 WIN32_NT 9200 
_FFConnect: AutoIt: 3.3.12.0
_FFConnect: FF.au3: 0.6.0.1b-10
_FFConnect: IP: 127.0.0.1
_FFConnect: Port: 4242
_FFConnect: Delay: 2ms
_FFConnect ==> Timeout: TCPConnect Error: 10061
_FFConnect ==> General Error: Timeout: Can not connect to FireFox/MozRepl on: 127.0.0.1:4242
+>18:54:07 AutoIt3.exe ended.rc:0
+>18:54:07 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 6.009

 

any thoughts?!

Link to comment
Share on other sites

I have got the same trouble. I even had trying to check MozRepl through a telnet, but it says
 

Could not open connection to host, on port 4242…

 

In addons menu of FF 35.0.1 it seems like MozRepl was not installed properly.

post-89842-0-12063700-1424271788_thumb.j

Because it doesn't have any other options, but a "Disable" and a "Remove"

I was trying to install MozRepl from both the github and the add-ons for FF and with turned firewall off and disabled other extensions, you see.

Edited by AutoRun
Link to comment
Share on other sites

Is there a bug on line 1396 from FF.au3?

Switch $sOptionMode
        Case "index"
            If Not IsInt($vOption) Then
                SetError(__FFError($sFuncName, $_FF_ERROR_InvalidDataType, "(int) $vOption: " & $vOption))
                Return 0
            EndIf
            $sOption = "position()=" & $vOption + 1
        Case "text"
            $sOption = StringFormat("contains(.,'%s')", $vOption)
        Case "name", "id", "value"
            $sOption = StringFormat("@%s='%s'", $sOptionMode, $vOption)
        Case Else
            SetError(__FFError($sFuncName, $_FF_ERROR_InvalidValue, "(index|text|name|id|value) $sOptionMode: " & $sOptionMode))
            Return 0
    EndSwitch

And the way to do it better:

Case "text"
            __FFValue2JavaScript($vOption)
            $sOption = StringFormat("contains(text(),'%s')", $vOption)

In that case the function __FFValue2JavaScript($vOption) gives to it more flexibility to select by an option text value with non-ASCII chars.

Link to comment
Share on other sites

I made a static example for the select form, but it work correctly with both original and modified _FFFormOptionSelect function

A problems are appear when the code works with the admin page. Engine's DLE (Data LifeEngine).

I can't explain it more exactly. It's only that the modified function works under the real condition in that case and original is not.

Also _FFFormCheckBox going well when it a static page and not working at all when it online.

Link to comment
Share on other sites

  • 8 months later...

 Hi all Pls help me!

i want click button add to library at google photo but it not is buttone or link then i want use xpath for click this but i don't know how use FFclick funtion with xpath??

<div role="button" class="mUbCce fKz7Od cx6Jyd M9Bg4d" jscontroller="VXdfxd" jsaction="click:cOuCgd; mousedown:UX7yZ; mouseup:lbsD7e; mouseenter:tfO1Yc; mouseleave:JywGue; touchstart:p6p2H; touchmove:FwuNnf; touchend:yfqBxc(preventMouseEvents=true); touchcancel:JMtRjd; focus:AHmuwe; blur:O22p3e; contextmenu:mg9Pef;" jsshadow="" jsname="LgbsSe" aria-label="Add to library" tabindex="0" data-tooltip="Add to library" data-tooltip-vertical-offset="-12" data-tooltip-horizontal-offset="0"><div class="VTBa7b MbhUzd" jsname="ksKsZd"></div>

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...