Jump to content
Sign in to follow this  
IAHIM

any up to date Firefox automation howto ?

Recommended Posts

IAHIM

Hi guys,

I have been looking today for a way to automate Firefox or embed it into Autoit GUI just like IE. I have found a lot of old posts with solutions that are not really up to date or working.

I have tried FF.au3 but i believe that MozRepl is too old for Firefox 31.

Can anyone give me a working solution or send me to the right documentation?

Thanks in advance,

Mike

Share this post


Link to post
Share on other sites
Danp2

No issues here. Are you sure that MozRepl is started?

Provide a detailed description of the problems you have encountered and any steps you have already performed to troubleshoot them. Also some basics like OS version, AutoIt version, MozRepl version, etc would be nice. :)

Share this post


Link to post
Share on other sites
IAHIM

Of course MozRepl was not started. But now it should work... except that i have an error.

I am running win 7 ultimate  firefox 31 and the last version of autoit.

My code is:

#include "ff.inc.au3"



; trying to connect to a running FireFox with MozRepl on
If _FFConnect(Default, Default, 3000) Then
    ; open a page
    _FFOpenURL("http://youtube.com/")
    Sleep(3000)
;~  $sObj = _FFXpath("//a[@href='http://www.mihaidesign.com/contact/']","",9) ; get the image with the alt-text test_bild_3 ...
;~  _FFClick($sObj) ; ... and click on it

    ; disconnect from FireFox
    If _FFDisConnect() Then MsgBox(64, "", "Disconnected from FireFox!")
Else
    MsgBox(64, "", "Can't connect to FireFox!")
 EndIf

The ERROR i get is :

__FFWaitForRepl ==> Error TCPSend / TCPRecv: TCPRecv:-1

Thank you in advance for your help.

Share this post


Link to post
Share on other sites
Danp2

This is due to a change in the way TCPRecv works. Look in the FF UDF thread for a posted solution (IIFC, it's a single line change to __FFWaitForRepl).

Share this post


Link to post
Share on other sites
IAHIM

thanks guys, i managed to fix the ff.au3 and i got it working.

Now another issue:

I want to click a span inside a table ... that is refreshed via ajax every 2 seconds. I tried getting the xpath but when i call the _FFClick it doesn't work. 

I can click other spans that are not generated via javascript.

Is there a way to accomplish this?  I have spent 2-3 hours looking into workarounds... maybe you guys know more.

Thanks again for all the help!

Share this post


Link to post
Share on other sites
computergroove

thanks guys, i managed to fix the ff.au3 and i got it working.

Now another issue:

I want to click a span inside a table ... that is refreshed via ajax every 2 seconds. I tried getting the xpath but when i call the _FFClick it doesn't work. 

I can click other spans that are not generated via javascript.

Is there a way to accomplish this?  I have spent 2-3 hours looking into workarounds... maybe you guys know more.

Thanks again for all the help!

Does the ajax data change every 2 seconds? Can you share the URL and identify the link you are trying to click so we can try it?


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites
IAHIM

Hi Computergroove,

I can't share it because is the web interface of a wireless access point. I need to change the password for the public SSID every morning.

The access point is behind 2 firewalls so is not publicly accessible.

The data changes every 2 seconds... and i have to click a span that triggers another DIV to be shown ... and there i have to click another link.

 

It seems that the only solution i can use .... is to use mouse clicks at specific coordinates... which is crappy ... and can not be really trusted.

Edited by IAHIM

Share this post


Link to post
Share on other sites
computergroove

Hi Computergroove,

I can't share it because is the web interface of a wireless access point. I need to change the password for the public SSID every morning.

The access point is behind 2 firewalls so is not publicly accessible.

The data changes every 2 seconds... and i have to click a span that triggers another DIV to be shown ... and there i have to click another link.

 

It seems that the only solution i can use .... is to use mouse clicks at specific coordinates... which is crappy ... and can not be really trusted.

It's true that clicking coords is not always reliable. What about sending the tab key x  number of times and hitting space? I have automated several websites this way.


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites
IAHIM

 

Thanks for the link.

Do you know where i can find a simple example of automating firefox? I saw that there is one, but i need something that integrates a form .. or mouse clicks. 

Thank you again for the link.

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
Sign in to follow this  

×