I tried using "exec()" to invoke the Internet Explorer. Now I want to interact with the IE such as opening an html file, click the view source, etc., In short I want to invoke some other menus of the IE. Is it possible with a Java Program. Does Java support such kind of operations. I want to access my local machine only not in a network.
No, you'll need to invoke some native technology to interact with the browser window, since Java has no access to it, beyond running IE. Off the top of my head I can't think of an easily available one. You might try browsing MSDN to find something suitable. [ January 11, 2007: Message edited by: Paul Sturrock ]
I did a Google on "win32 sendkey script" and got a lot of hits. We've been looking at some expensive commercial products that do a bang up job of this kind of thing: OpenSpan, Jacada, eGlue. Any GUI test tool should be able to do what you're after ... maybe you can extract some parts of one of those. A simple VB script might take you far enough, too. Let us know what you find!
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I would like to know what the actual requirements are here. In other words, why would you want to do that? Your original post suggests you want to get at the source code of an HTML page from the web somewhere, and for that you don't need to remote-control that hulking robot IE. You can access the code directly and easily using classes in the java.net package.
Thanks. My original requirement is i would like to generate some HTML files through my program after that i have to invoke them that means i have to Load the pages through my program not by requesting the user to double click the HTML file.
Thanks for your ideas. It works from my command prompt as an external command but when try to run from the Java Program using exec. Its not working.
java.io.IOException: CreateProcess: start C:/test.html error=2 at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) at java.lang.ProcessBuilder.start(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at Explorer.main(Explorer.java:4)
Getting the following error. So now trying using the Robot Class. Will update you about the results. Thanks, dinesh.