How to automate Firefox with iimInit ("-fx")

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

How to automate Firefox with iimInit ("-fx")

Post by Tech Support » Fri Jan 21, 2011 12:40 pm

Update 10/11/2013

To automate iMacros for Firefox 8.5.1 or later you need iMacros Enterprise Edition 9.02 or later.

Conversely, if you are using iMacros Enterprise Edition 9.02 or later, you need iMacros for Firefox 8.5.1 or later to automate Firefox.

Update 6/13/2012

To automate Firefox 13 or later you need:

1. Download iMacros for Firefox V7.5.0.1 or later: http://wiki.imacros.net/iMacros_for_Fir ... on_History

2. Download iMacros V8.02.1960 or later: http://wiki.imacros.net/Version_History

To automate Firefox 12 or lower you need:

1. iMacros for Firefox V7.5.0.1: http://wiki.imacros.net/iMacros_for_Fir ... on_History

2. iMacros V8.01: http://wiki.imacros.net/Version_History

Note: With the combination of iMacros 8.01 and iMacros-FF 7.5.0.1, the use of iimRunner is once again supported on Windows XP.

Update 10/10/2011

To automate Firefox 6 or later you need:

1. Download iMacros for Firefox V7.4.0.4 or later: http://wiki.imacros.net/iMacros_for_Fir ... on_History

2. Download iMacros V7.50 or later. Or, just download iimfirefoxconnector.dll and save it in your current iMacros program folder.

Note: The use of iimRunner with Firefox via iimInit ("-fx -fxProfile <name> -runner") is not supported on Windows XP.

Original Post 1/21/2011

Problem: The iMacros Scripting Interface DLL IOpusConnector.xpt is not included in the most current general release iMacros for Firefox installer (XPI) to circumvent a known bug in Firefox 3.6.x.

Solution:
We have rewritten our Firefox driver to work around the Firefox bug and at the same time improved speed and reliability. Improved reliability means in this case that iMacros handles Firefox quirks better :)

The result is that iMacros can now fully automate all Firefox versions, including the latest Firefox 4 Beta.

To automate Firefox with the iMacros Scripting Edition, you need:

1. Download iMacros V7.22 or later: http://wiki.imacros.net/Version_History

2. Download iMacros for Firefox V7.3.0.0 or later: http://wiki.imacros.net/iMacros_for_Fir ... on_History

After you have installed the new version, you can use iimInit ("-fx") and iimInit ("-fx -fxProfile <name>") to drive Firefox just as before.

:arrow: If you find any problems, please let us know by replying to this post!
skabaas
Posts: 16
Joined: Mon Sep 06, 2010 9:03 am

Re: How to automate Firefox with iimInit ("-fx")

Post by skabaas » Fri Jan 21, 2011 2:33 pm

Installed the new Beta and the Firefox plugin... Seems like "-ie" or "-fx" stopped working? iimInit now always fires up the iMacros-browser?
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Re: How to automate Firefox with iimInit ("-fx")

Post by Tech Support » Fri Jan 21, 2011 2:41 pm

I just retested and all works fine for me.

Did you uninstall any older iMacros 7 version? (Only iMacros V6.x can be used in parallel)
mjayson
Posts: 11
Joined: Thu Sep 02, 2010 8:10 pm

Re: How to automate Firefox with iimInit ("-fx")

Post by mjayson » Sat Jan 22, 2011 9:04 am

Great news!. Any new update on the native linux immrunner?
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Re: How to automate Firefox with iimInit ("-fx")

Post by Tech Support » Sat Jan 22, 2011 9:53 am

Any new update on the native linux iimrunner?
The Windows and Linux Firefox Scripting interfaces share the same code base. We have one Linux specific bug left to fix. So I think that it can be ready next week.
skabaas
Posts: 16
Joined: Mon Sep 06, 2010 9:03 am

Re: How to automate Firefox with iimInit ("-fx")

Post by skabaas » Wed Jan 26, 2011 9:53 am

I figured out where I went wrong, but now I'm running into another little bug:

Firefox seems to handle imacros.iimGetLastExtract different than the normal iMacros browser:

Same code, same extract, different outcome:

iMacros browser:
Image

Firefox:
Image

However, when I use iimGetLastExtract(0) instead of iimGetLastExtract(1), I get the expected result!

Firefox:
Image
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Re: How to automate Firefox with iimInit ("-fx")

Post by Tech Support » Wed Jan 26, 2011 10:22 am

Strange, it works for us. Can you try with this script:

Code: Select all

Option Explicit
Dim iim1, iret
Dim rn, i, keyword
Dim code

code = "CODE:URL GOTO=google.com" + vbNewLine+ "TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:f ATTR=NAME:q1 CONTENT=x"

set iim1= CreateObject ("imacros")
iret = iim1.iimInit("-fx",true)
MsgBox "Init" + vbCrlf + "Error Code: "+cstr(iret) + VbCrLf + "Error Text: "+iim1.iimGetLastError()

iret = iim1.iimDisplay(iim1.iimGetInterfaceVersion())
MsgBox "Display" + vbCrlf + "Error Code: "+cstr(iret) + VbCrLf + "Error Text: "+iim1.iimGetLastError()
iret = iim1.iimPlay("Demo-Extract")
MsgBox "Play" + vbCrlf + "Error Code: "+cstr(iret) + VbCrLf + "Error Text: "+iim1.iimGetLastError()
Dim s,index
For index = 0 To 10 Step 1
s = iim1.iimGetLastExtract(index)
MsgBox s
Next
MsgBox "Extract" + vbCrLf + "Error Text: "+iim1.iimGetLastError()

MsgBox "Close browser"
iret = iim1.iimExit
MsgBox "Exit" + vbCrLf + "Error Code: "+cstr(iret) + VbCrLf + "Error Text: "+iim1.iimGetLastError()
WScript.Quit(0)
You can see that the first extraction message box returns the all (separated by [EXTRACT]) and the other ones return one by one, until the last 3 return empty (there are only 7 extracts and 11 message boxes).

Please make sure you use the latest 7.20 build.
skabaas
Posts: 16
Joined: Mon Sep 06, 2010 9:03 am

Re: How to automate Firefox with iimInit ("-fx")

Post by skabaas » Wed Jan 26, 2011 10:38 am

Tech Support wrote:Strange, it works for us. Can you try with this script:

Code: Select all

Option Explicit
Dim iim1, iret
Dim rn, i, keyword
Dim code

code = "CODE:URL GOTO=google.com" + vbNewLine+ "TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:f ATTR=NAME:q1 CONTENT=x"

set iim1= CreateObject ("imacros")
iret = iim1.iimInit("-fx",true)
MsgBox "Init" + vbCrlf + "Error Code: "+cstr(iret) + VbCrLf + "Error Text: "+iim1.iimGetLastError()

iret = iim1.iimDisplay(iim1.iimGetInterfaceVersion())
MsgBox "Display" + vbCrlf + "Error Code: "+cstr(iret) + VbCrLf + "Error Text: "+iim1.iimGetLastError()
iret = iim1.iimPlay("Demo-Extract")
MsgBox "Play" + vbCrlf + "Error Code: "+cstr(iret) + VbCrLf + "Error Text: "+iim1.iimGetLastError()
Dim s,index
For index = 0 To 10 Step 1
s = iim1.iimGetLastExtract(index)
MsgBox s
Next
MsgBox "Extract" + vbCrLf + "Error Text: "+iim1.iimGetLastError()

MsgBox "Close browser"
iret = iim1.iimExit
MsgBox "Exit" + vbCrLf + "Error Code: "+cstr(iret) + VbCrLf + "Error Text: "+iim1.iimGetLastError()
WScript.Quit(0)
You can see that the first extraction message box returns the all (separated by [EXTRACT]) and the other ones return one by one, until the last 3 return empty (there are only 7 extracts and 11 message boxes).

Please make sure you use the latest 7.20 build.
Does seem to work indeed (and yes, I am using the latest RC build). I get a couple of messageboxes and the extracting seems to work fine. However, I'm extracting from a combobox (which is not available in this example). Perhaps that's the problem?

Image

[edit]
That does seem to be the problem. Check out the following scriptcode, which makes use of this topic:

Code: Select all

Option Explicit
Dim iim1, iret
Dim rn, i, keyword
Dim code

code = "CODE:"
code = code + "VERSION BUILD=7201198" + vbNewLine
code = code + "TAB T=1" + vbNewLine
code = code + "TAB CLOSEALLOTHERS" + vbNewLine
code = code + "URL GOTO=http://forum.imacros.net/viewtopic.php?f=8&t=12254" + vbNewLine
code = code + "TAG POS=1 TYPE=SELECT FORM=ID:viewtopic ATTR=ID:st CONTENT=%14" + vbNewLine
code = code + "TAG POS=1 TYPE=SELECT FORM=ID:viewtopic ATTR=ID:st EXTRACT=TXT" + vbNewLine

set iim1= CreateObject ("imacros")

iret = iim1.iimInit("", true)

iim1.iimPlay(code)

MsgBox iim1.iimgetlastextract(1)
When you run the same code with the "-fx" parameter, you get an empty msgbox. When you run this code, you get "2 weeks".
[/edit]
Tom, Tech Support
Posts: 3834
Joined: Mon May 31, 2010 4:59 pm

Re: How to automate Firefox with iimInit ("-fx")

Post by Tom, Tech Support » Wed Jan 26, 2011 4:49 pm

Hi skabbas,

Thank you for the detailed report and sample code. We are working on resolving the issue.
Regards,

Tom, iMacros Support
ejerue
Posts: 1
Joined: Wed Aug 11, 2010 4:32 pm

Re: How to automate Firefox with iimInit ("-fx")

Post by ejerue » Tue Feb 01, 2011 9:05 pm

I am unable to get FireFox 4 beta 10 to launch from a perl script on Windows 7 64 bit w/ 7.20 & 7.1.1.1 extension (compatibility check disabled in FireFox to allow install). I have yet to get any version of FireFox to launch actually but figured that was due to the bugs w/ firefox and was waiting for this release. IE and the iMacros browsers successfully launch and run from this same script. I have the iMacros extension pane open in FireFox and am at a loss as to why it will not run.
Tom, Tech Support
Posts: 3834
Joined: Mon May 31, 2010 4:59 pm

Re: How to automate Firefox with iimInit ("-fx")

Post by Tom, Tech Support » Thu Feb 03, 2011 12:19 pm

Thanks again for reporting the issue Erik, we are working on a fix.
Regards,

Tom, iMacros Support
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Re: How to automate Firefox with iimInit ("-fx")

Post by Tech Support » Thu Feb 03, 2011 9:32 pm

We released V7.1.1.2 that solves the issue with Firefox 4 Beta 10:

http://wiki.imacros.net/iMacros_for_Fir ... on_History
mjayson
Posts: 11
Joined: Thu Sep 02, 2010 8:10 pm

Re: How to automate Firefox with iimInit ("-fx")

Post by mjayson » Wed Feb 09, 2011 4:04 am

We just tried the new version and got an error (see attachment).

IMacros version 7.20.1184

Firefox 3.6.13 with plug-in 7.1.1.2

We'll launching the macros through php with iimrunner.

The macro seems to be running even despite the error messages, anyone else got the same message?

Thanks
Attachments
imacros-error.jpg
User avatar
Tech Support
Posts: 4948
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Re: How to automate Firefox with iimInit ("-fx")

Post by Tech Support » Wed Feb 09, 2011 12:48 pm

We'll launching the macros through php with iimrunner
iimRunner is not yet supported with the new Firefox interface. We are working on it right now and plan to have a solution early next week.
echan00
Posts: 10
Joined: Tue Feb 22, 2011 3:59 am

Re: How to automate Firefox with iimInit ("-fx")

Post by echan00 » Tue Feb 22, 2011 7:07 pm

What if I'm using iMacros for Firefox? (http://www.iopus.com/download/imacros-firefox/)

I don't use "iimInit ("-fx")" as I am only using the simple scripting for the browser plugin... will the same fix for the browser plug-in be done?
Post Reply