Start Firefox/Chrome using Java code

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
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
Post Reply
JagadeeshK
Posts: 8
Joined: Tue Jan 05, 2016 3:41 pm

Start Firefox/Chrome using Java code

Post by JagadeeshK » Mon Feb 29, 2016 9:05 am

Hi,

FF Version - 43.0.2
iMacros Version - 11
OS - Win 7


I followed the steps mentioned in the below URL, and I'm able to launch the imacros browser without any issues.
http://forum.imacros.net/viewtopic.php?f=6&t=10899

below is my code

Code: Select all

package Execution;
import com.jacob.activeX.*;

public class exec {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		ActiveXComponent iim = new ActiveXComponent("imacros");
		
		  System.out.println("Calling iimInit");
	      iim.invoke("iimInit"); // call iimInit()
	      
	      System.out.println("Calling iimPlay");
	      iim.invoke("iimPlay", "CODE:URL GOTO=http://www.google.com"); // call iimPlay()
	}

}
I tried to launch the firefox browser using the same code,

Code: Select all

ActiveXComponent iim = new ActiveXComponent("firefox");
but it displayed the below error message,

Code: Select all

Exception in thread "main" com.jacob.com.ComFailException: Can't get object clsid from progid
	at com.jacob.com.Dispatch.createInstanceNative(Native Method)
	at com.jacob.com.Dispatch.<init>(Dispatch.java:99)
	at com.jacob.activeX.ActiveXComponent.<init>(ActiveXComponent.java:58)
	at Execution.exec.main(exec.java:8)
Could you plz help me on this.

Thanks,
Jagadeesh.K
IrishMacro
Posts: 135
Joined: Wed Nov 03, 2010 12:27 pm

Re: Start Firefox/Chrome using Java code

Post by IrishMacro » Thu Mar 03, 2016 12:12 pm

You can launch FF by using commandline

Click start and Run
Paste into Run -
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" imacros://run/?m=<YourMacroHere>.iim
Firefox free plugin, last version
Win7
Post Reply