Does anyone know if it is possible to interact with a java applet via .net?
Edit: I was able to use the UI Automation framework to locate the java applet, and from there use OCR to read data and simulate mouse/keyboard input into the applet.
You may well be able to do it using accessibility APIs, which are designed to let screen-readers and so on interact with programs. Have a look at:
http://en.wikipedia.org/wiki/Microsoft_UI_Automation
Related
I have to automate a JWS application (with *.jnlp extension) . We cannot automate the same using selenium as it is an windows type application. I also tried with AutoIt but it is not able to capture element properties using the same.
Could anyone please help how can I automate this application .I am trying to automate JWS application for the first time.
QTP and TestComplete are very good to automate Java desktop applications. I am using QTP currently to automate Calypso (a java application) and it works perfectly. I've used TestComplete previously to automate similar Java desktop application. They both are paid software, but well worth it if you want to automate complex applications.
Swing applications can be automated using [SWTBot][1]. Its an open source alternative to automate swing applications. This requires understanding of Swing framework and controls.
[1]: http://www.eclipse.org/swtbot/
EDIT: Maybe any of this can help for testing swing applications: Automated tests for Java Swing GUIs
I would like to use Google Web Toolkit's GUI in common java application instead of Swing. How could I implement that? Could anybody show the simpliest example how to do this?
I would like to use Google Web Toolkit's GUI in common java application instead of Swing.
No. That's not the way how GWT works. GWT's java GUI code compiles to JavaScript and runs in Browser.
So the answer is No.
I was wondering how I could embed a browser like view in a Java client application, at the same time that I can interact with it by means of JavaScript.
The problem that triggered this question is the following:
The interface of my application consists of a (Google) map and some svg stuff.
This is easy to do in a browser.
However, I also need access to some special Java libraries that can process some information from the map (e.g., certain coordinates in the map) and that answers values that should influence the browser view (e.g., a path should be drawn over the map).
My first idea was to implement the Java side behaviour as a REST web service, so from JavaScript I will invoke this webservice sending relevant information about the map and using the answer to update the map. Nevertheless, for my current needs (this is only a prototype) using webservices is a bit too much of infrastructure.
Is there a way I could just:
embed a browser like view in my Java application.
Interact from the Java side with this view by means of JavaScript functions implemented in the web page displayed in the browser view (such as these functions will influence the rendering of the page in the browser like view) ?.
I found other questions related to how to embed a browser in a swing application (e.g., Embedding web browser window in Java) and JDIC seems to be able to do this. Although some people report it is difficult to make it work in OSX (the OS I use) and do not mention if it is possible to interact with the browser by means of JavaScript.
It seems to me that in Android it is possible to make JavaScript calls from the Java (Android) side, so probably this is also possible in plain Java.
Thanks for any pointer !
With Java FX 2 you can. You get a webkit webview there. Can interact with it back and forth with java<->javascript.
For an example embedding google maps see: http://java-buddy.blogspot.se/2012/03/embed-google-maps-in-javafx-webview.html
You can embed java fx in swing with JFXPanel if you don't want to go with 100% JavaFX yet.
If you can use swt, take a look at SWT Browser widget
For javascript you can use
http://www.mozilla.org/rhino/
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
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