In the lab I work in, we use Mozilla 1.7 for Sun Java™ Desktop System and Firefox 2.0.0.4. My goal is to modify an existing Java application (run via executable jar) to communicate with our web-based login system.
I am open to the idea of using both Java Applets and JavaScript to accomplish this task, but I have not found a way to integrate these two technologies in any browser but Netscape Navigator and Internet explorer.
Is there a way to do this using either of the two aforementioned browsers?
A more concrete example:
1. Launch application
2. Click a "login" button
3. Be prompted for a password
4. In the background, have the application connect to the web-based login server, enter the username (known by the app) and the password, navigate to the time clock section and "click" the Punch In button
5. Pull the timestamp of the login (typically displayed on the browser) and display it in the app
Look at HTTPURLConnection and perform POST of the same values login form contains to the same URL.
Related
I'm developing a web app (in Spring Boot) that would need to simplify the user interaction with other websites (third party, not developed by me). The idea is that my app pre-fill a form so the user won't have to do it.
As I began to read about this I stumble upon HtmlUnit and then Selenium... I tried Selenium and I was very happy while I was developing because I manage to open a browser window and fill it as I want it.
Then I thought it would be a good idea to test it from another computer in the same LAN. So open up a browser, navigate to my ip:port and when I hit the button that should perform the automation described, the browser open up on my "server" machine where the app is running and not on the client.
It was very frustrating. Keep reading and I found something about Selenium Hub and Grid. I've read several articles about it but it confuses me because they are all oriented at performing tests and I don't even understand where should I start or if it even possible.
What I want is to have my web-app installed in a Ubuntu Server and any client could access it and when hitting a button open a web page in a specific URL and pre-fill the form data.
Can you guide me? I'm in the correct path with Selenium Grid and Hub or there's any other technology I should be using?
We are facing this issue on our clients machine.
Our project uses a third party java applet to open the files in respective softwares.
On windows7 we don have any issue but we have issue on windows8 OS
our project is working fine in IE10 and FF browsers. of windows8
this error is thrown only in chrome.
but when we execute same third party demo site which uses this same java applet to open the files in respective softwares, that is working fine in all browsers without making any changes in settings.
I have read many replies from different ppl that we need to changes the client java secutiry settings.
But how can we ask all our clients to make this setting so this is not a proper solution for our problem.
Please see the image below
![Error message][1] is
"Your security system have blocked an application with expired or not yet valid certificate from running"
please help me solve this ..
Go to Control Panel -> Java -> Security -> Edit Site List
Solution published in my website:
http://www.myerrorsandmysolutions.com/application-blocked-by-security-settings/
Go to Control Panel
Java
in the Security tab click the “Edit Site List…” button
click Add button
insert the URL of the website that you want access in (URL should begin with http:// or https://)
click Add button
click OK button
click OK button
Note: you could find an icon Java (32-bit) rather than Java.
If you won’t find in Control Panel a Java icon or the “Edit Site List…” button is missing and you are sure that Java is installed, open a text editor and create a file with name exception.sites containing the URL of the website that you want access in (URL should begin with http:// or https://) and save it in the following path:
C:\Users\username\AppData\LocalLow\Sun\Java\Deployment\security
where
username
is the name of the user.
go to Control Panel -> Java -> Security , choose minimum security level , Medium(Least secure setting), then click ok , save and try again...
Previously, in order to use Google Drive service, we are using the following simple username and password login in Desktop application with Google Documents List API
DocsService client = new DocsService(getCloudApplicationName());
client.setUserCredentials(username, password);
As in Google announcement, https://developers.google.com/google-apps/documents-list/, Version 3 of the Google Documents List API has been officially deprecated as of September 14, 2012. It will continue to work as per our deprecation policy, but we encourage you to move to the Google Drive API.
So, in our desktop Swing application, we need to rewrite the code to gain authentication to Google Drive service.
By referring to code example run at console https://developers.google.com/drive/quickstart-java#step_3_set_up_the_sample
Please open the following URL in your browser then type the authorization code:
https://accounts.google.com/o/oauth2/auth?access_type=online&client_id=888888888888.apps.googleusercontent.com&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&scope=https://www.googleapis.com/auth/drive
User need to open up the browser manually.
Key in his username and password.
He will then obtain a special string from browser, where he needs to copy and paste to the console.
I think I can pretty much simply the process, by using a web view component Integrating JavaFX 2.0 WebView into a Swing Java SE 6 Application, so that the above task will be automated.
However, the webview's component previous history session will be destroyed as I close my desktop Swing application. User need to key in his password and username every-time he launch the desktop app.
From official Google Drive app for Windows, I realize it does have the capability to remember the last authentication of the user. User just need to key in his username and password once. He can then use the Google Drive service again and again, even after restarting the computer.
May I know how I can achieve the similar behavior?
You need to permanently store web view's cookies and set them again once you launch the web view again.
I'm remote controlling a Java application on a PC through an Android phone, and I needed my application to open a browser at the phones command, chrome in this case. I created a "Process" for chrome, opening a certain address. However, I need to be able to give tools on the Android phone for controlling the web page, such as scrolling. Can I programmatically send a command for chrome to scroll from my PC application containing the Process?
Sorry, it may have been unclear, but the only connection the android phone has to the program is through a socket. It is only used as a remote control for another Java application on a PC, which has its own screen.
I do not think that clean solution exists.
But I can suggest the following directions:
(1) try to investigate the native chrome API. If it has such ability call it with JNI.
(2) Try to use class java.awt.Robot. It allows to simulate user's activity, e.g. mouse clicks. Unfortunately it does not allow you to find any window outside your application, so it is a problem to decide where to perform the click.
(3) You can create proxy server and make browser you open to go to the target URL through the proxy. The proxy server will insert into the page your javascript that will communicate with server. The application that opens browser will send commands to server. The javascript that you inserted will receive these commands using AJAX and perform them. JavaScript can scroll browser window, so theoretically you can implement this.
If you can target the tab you want to control and edit the address bar you could send the command 'javascript:scrollTo(x, y)'. I just tested it on this page and it seems to work fine, replacing what I typed with the original address of the page.
Can I programmatically send a command for chrome to scroll from my PC
application containing the Process?
Not directly. What you could do is make some sort of web service that sits between the Android client and page that the Android client can send commands to and the page can periodically poll via AJAX calls to see what the client wants. That would be a clean DIY way that would work on other browsers besides Chrome.
You can use vnc viewer applications for that.
http://code.google.com/p/android-vnc-viewer/
i am doing a master project on how java applet works with web browsers.Can anyone give me details or any link that can be useful.How the web browser interacts with the java applet.
Download the source of Mozilla (Firefox, e.g.)
Read the code that integrates the JRE for applets.
Ask more questions when specific issues arise.
Maybe a simple answer will be enough and it won't require reverse-engineering Mozilla.
Until recently, applets did not interact much with the browser. The browser sent only 'start', 'stop' and 'resize' events to the applet and the applet could order the browser to open new web pages. With the Java 6 update 10, there is a possibility to call Applet functions from JavaScript and to call JavaScript from an Applet, as long as they are on the same page.
The browser creates a 'sandbox' to run the applet. The sandbox limits the access rights of the applet (e.g. applet can connect to TCP ports only on the web server, cannot access files directly on the client file system, etc.). Besides these limitations, an applet is like an autonomous application running on the client box.
You can find info on applets at 'http://java.sun.com/applets/' and 'http://java.sun.com/docs/books/tutorial/deployment/applet/index.html'