hii every one
good morning
I have created one project on JApplet
it runs successfully on Applet window
but i want to run it on web browsers(Internet explorer , Mozilla firefox, Safari, etc.)
I m using Mac os x and i want to run it on Safari.
You have to create an html which refers to the applet. Open the html in browser.
Take a look here for the applet tag http://www.w3schools.com/TAGS/tag_applet.asp
Using Mac OS X, in /Applications/Utilities you'll find Java Preferences.app. In the Advanced tab, you can enable the Java Console, which may tell you more about what's wrong when you open your HTML page in a browser.
Also, you can edit your question to add code, etc.
Addendum: You might want to start with a known working example.
Related
My problem is when I click on a desktop icon, it opens a link in already opened chrome browser in a new tab. How do I attach with the already opened browser and not a new one?
The below code returns a null because there is no window opened through selenium ofcourse, so yeah.
Set<String> windows = webdriver.getWindowHandles();
System.out.println(windows);
Any suggestions would be of great help. Thanks In advance.
There is no way to attach the chrome window that you've opened from the desktop application to your WebDriver instance.
If you want to be able to control a web page with a Selenium - you must pass your URL to a driver like that:
webdriver.get("https://www.your_link.com");
You might think about the way of getting and storing your URL as a variable and passing it into your code.
That would also be helpful if you add a bit more details about the problem. It's a bit unclear at what stage of the test you open the web page with a desktop application. Selenium can't be used to test desktop applications. Code sample of the test from your project would also help.
I was wondering how to open a locally stored java applet in chrome or edge. I was using the IE tab extension and it doesn't seem to work on locally stored applets. Any suggestions?
I dont think Chrome supports plugins anymore, but you could use internet explorer and just enable scripting of java applets.
I need to pass parameters between Java applet and Html by input data into textbox
and click button. Because it must input data and past to applet in the first place,
but how to slow down the applet ? I used to try using inner html , but it's failed.
Is there any idea for this question?
You could use netscape package. This documentation on this is found here. I have used this myself at times. Works on chrome, IE both windows and mac. Safari can also be tricked to work, but needs some workarounds.
I've got a need to navigate java-applet programmatically and I am not that keen on Java platform. So lets assume I've got IE process stated with appropriate java applet loaded. Next I need to have some actions taken to this particular applet, like, lets say, sending WM_COMMAND to dialog along with BN_CLICKED code like I do with Windows in C. Assuming it's not a regular window I can refer to using HWND, I would like to ask someone for recommendations on how to do this.
As I understand you want to navigate (sending keystrokes and mouse clicks) a java-applet on the client side. It depends if you own the applet (say: you have the code and can change it) or if the applet is closed source and you just want to remote it.
In the first case use javascript to automate it. Change the containing HTML page to include some Javascript and pass parameters to the applet as described in the Java Tutorials.
If the applet accepts parameters, but you cannot change the HTML page, use a GreaseMonkey alternative for IE.
Your other approach (sending Windows Messages from an extern application to IE) should also work. Start Spy++ (use the 64bit version if you are using a 64bit Windows), choose "Search - Find window..." and drag the "Finder Tool" icon over the applet and release it. You will see then the HWND and if you press search you will see the window inside IE window hierarchy. So, yes you can send keystrokes and mouse clicks to a browser.
If I would automate the browser I would use Geb. You code a "web site test" in Groovy, just look at the Geb index page.
You could try to record a navigation through the applet with FireFox + "Selenium IDE" then export it and try run it in a Java Application with the Selenium IE WebDriver.
Information about Selenium can be found here : http://docs.seleniumhq.org/
Maybe this question will also help you : How to automate Java applet?
I have a Java program that runs from command prompt / blueJ's terminal window fine.
Is there a way that I can run this from a browser?
I guess my question is, is there anything that simulates the terminal window in a browser?
If not, do you have a suggestion as to how to put this online? It uses scanner / system.out.println a lot.
Thank you
There are two main technologies for helping publish a Java application via a browser:
Applets (displays inside a browser, kind of like Flash)
Java Web Start (launches via browser, but then runs and displays in a separate window.)
It most most common to use Swing to develop the user interface of an Applet or Java Web Start application. So it might be interesting to read about how to emulate a console window in Swing.
I'm not sure if this helps, but when you access a website that uses Java, with your browser, you can decide to see the Java console, if you have it enabled in your Java settings. But only people with that option turned on will get to see it.
Otherwise you could use javascript to incorporate results into the html of the page, or maybe make an applet with a "console" included.
You can embed in an applet, not only GUI you can use applets to invoke any method. And you can view console view ,[ Java Icon pops up on system tray bar in windows,on right clicking on the java icon, you can view console ]