I know this can be a bit of weird question, but let me explain the idea behind it first.
I have a win32 app exposed a an Activex host, this gives me the the following useful features:
Embed and call it from Internet Explorer as a simple to pass/return values from it using javascript.
Embed and call it from any win32 application made in languages like visual basic, c++, delphi etc. Even i can call it from MS office products like excel and word.
I have been asked to migrate this app to Java SWT but i donĀ“t know if it can be done without losing the mentioned capabilites, the only way could be to expose the app itself as an Activex host, can this be possible?.
Thanks a lot.
I have no experience with ActiveX, but a lot of examples are in snippets folder at SWT homepage. Try to check them..
If you migrate your app to Java SWT then you will lose the desired functionality of using in IE and as well as in other MS product based on COM or ActivX technology. Although one crude way could be to use some bi-directional COM broker like Jacob.
If given a choice then I will utilize the SWT's in-built support for COM and will try to embed your activex component in my swt application. For example, you can look at:
org.eclipse.swt.browser.IE -- Allows access to IE ActiveX component in the form SWT browser control.
org.eclipse.compare.internal.win32.WordComparison this is a part of eclipse's file diff plugin. The class is very nicely written and gives a COM flavored snippet of diffing two MS word files.
In this way I can have the activex intact for whatever purposes.
There is this article on adding activex support to swt without using any third party COM bridge
Related
I need to implement a simple browser in java. I've been researching several possibilities including JxBrowser, JBrowser, JavaFX (WebEngine + WebView), among others. JxBrowser has potential but it's a paid library, which I would like to avoid.
This browser needs to be able to process all web functionalities including JavaScript and HTML5 while capable of connecting through proxies. Therefore the best solution may be to use a web engine like Gecko.
So I'd like some advice on libraries which are capable of implementing Gecko engine (including XULRunner) with the possibility of changing core Gecko preferences.
Also, if you know any other possible solution that doens't include Gecko, feel free to discuss.
Have you tried SWT Browser widget?
For proxy in SWT Browser, see How do I set a proxy for the Browser to use?,
I need a integrated or embedded java browser. I used WebEngine of javafx which support basic css as well html & java script but could not able to run flash file. Any way to do so.
Or any other Project u know which could fulfill my requirement.
You can also look at JxBrowser Java library that allows embedding Chromium-based web browser control into Java AWT/Swing application.
It supports both Java Swing and JavaFX.
BTW: the browser control is totally lightweight. All rendering happens in a separate native process by native Chromium engine. The web page looks like it's displayed in Google Chrome.
Check those (although they are not JavaFX but I suppose that they can be used):
http://lobobrowser.org/java-browser.jsp - pure Java
http://www.javadesktop.org/articles/jdic/index.html - better imho, but no longer maintained
We need a tool to test a set of fairly complex Java applications. The applications are mostly independent client programs or applets communicating with a servlet or apache server at a remote site. Specs:
Runnable on Windows XP, Vista and 7
Parameterizable (Can specify in a script the sequence of buttons to click, text to type in JTextFields and browser address bar etc.)
Can quit or bail out or display a nasty message if the expected window or dialog box doesn't appear
Record the output on the Java Console of browser in a .txt file (IE is sufficient for now) when the application opens a browser window.
While running, I should be able to see it running with folded hands while it would run
for a few minutes
We were thinking of writing an AWTRobot based tool that reads a command file and does this - (don't know how to do #3 or #4 yet - will ask you folks some day how to detect a window on the desktop). Would you suggest an open source tool available to do this? We don't need anything fancy to capture video or screenshots. Thank you, - M.S.
For browser based automated testing you can use Selenuim or you can use WebDriver.
The selenium project is hosted here
If you don't need to test the way the pages are actually rendered by the browser, but instead need to work at the HTTP/HTTPS/etc request level then have a look at JMeter. It has parametrization, dataproviders, graphs, and a proxy component for recording http user sessions.
If you do need browser testing, then, as has already been mentioned, Selenium is probably the best freely available tool. For production I would recommend using Selenium Remote Control server which can be driven by scripts written in Java/Python/C#/Perl/PHP.
To see what tools people use in real production environments, and to do your own research on what is available I recommend www.sqaforums.com.
Have a look at Sikuli
The reason I suggest this is it sounds like you need to test both a Java applet and the content of a native browser (launched from Java, but not itself Java) -- so it's not "Java all the way".
I'm not sure what you mean by criteria 4, though. It is worth noting that as Sukuli works by image analysis, it won't be able to copy text to a text file.
This question is an invitation for sales pitch, don't you think. How about Mercury Quicktest professional ( I believe its HP Quick test now). I do not believe this will be cheap either ( and well its HP, it will probably only work in IE ;)).
Since you want an open source solution, I believe, the most popular option is selenium and yes its a pain to configure sometimes ( like for Flex for example). So you should try Watir.
There is a lot of good buzz around it and when I evaluated it, I loved what I see.Also it does not work for desktop applications, I suggest you try some other solution for that.
(The problem is open source GUI testing tools are not usually all inclusive. If you need one solution to handle all your gui testing needs, then you should check out the more commercial ones like QTP.
I have used IBM Rational Functional Tester. It has everything you need and it's quite easy to learn. The scripting language is either Java or VB.Net so you won't have to worry about learning a language for your tests.
I had some pretty good results with Squish from FrogLogic and didn't break the bank: http://www.froglogic.com/products/
Did you try Squsih - http://www.froglogic.com/products/index.php
I want to display a silverlight web page inside my java desktop application.
Does anyone know of a plugin or browser control that I can use to do this?
Embed an appropriate browser window into the Java app and it can load the SL - there will not be any interaction / communication between the two without some hacky code. Multiple browsers support SL but you are better off using the an IE based one at present, the chrome support is not official as I remember.
How about an iFrame? In the nutshell... Alternatively you can make a request to .Net app from within your java server code using something like HttpClient and then serve markup that way - would be relatively easy thing to do (relatively since if there authentication involved things can get complicated fast. And if you want (willing) to get "sophisticated" and you are using portlet technology there is WSRP
For the desktop app I would go with HttpClient suggestion: get the content, parse it then do with it what you please unless that Silverlite app is also running as webservice then you have some additional options by utilizing components that can consume services
Eclipse's SWT provides out of the box web browser component based on IE and/or Mozilla engine. For swing application you can use one of ActiveX bridges, such as J-Integra or JDIC or EZ JCOM.
Use JDIC WebBrowser component
Is there a way to display a Flash or Adobe Reader ActiveX control in a Java AWT frame?
I'm porting a large old J++ application to standard Java and it needs to host a certain ActiveX control on an AWT frame.
Is this possible?
I looked at the JACOB (Java to COM Bridge) project and it doesn't appear to support ActiveX objects that draw on the screen.
It looks like this can be done by mixing AWT and SWT.
The Eclipse project has a sample snippet that embeds Microsoft Word into an AWT/SWT mixed app.
It appears that you will need to purchase a proprietary library in order to able to do this, as Java itself doesn't allow access to COM. Another similar question (about just Flash in Java) can be found here and a couple commercial solutions were listed.
I should note that whatever route you end up taking, you should optimally try to find a library that provides access to an Internet Explorer control, as opposed to just Flash or Adobe Reader. That's because, once you have access to an IE element, you can provide it with a URL (even if it's a local file) of either a .swf or .pdf document, and it will automatically load the correct plugin for each (I used this shortcut once for a personal C++ project in which I needed to load several different ActiveX controls). It appears that the EasyJCom library at the above link does provide such access to an embedded IE control.