I've been using the Desktop -> browse() method so far to open the default browser with a URL i now want to move opening 3 different browsers: IE, Chrome, Firefox what would be the best solution to do this?
I was thinking just Inputting into the Cmd line
start (browser.exe) (URL) as that would work
Or is there a better solution?
Many thanks for any advice
Related
I want to make a simple program that ask you which browser you want to use.
When you'll click on a link (email or pdf for example), a program will appear instead of the browser and will ask you which browser you want to use.
First : in which code it's the best to write this?
Secondly : How to open the program and not the browser?
I need a bit of help to write this, because i don't know how begin
This is tricky. There is no uniform event for "User clicks on url" that spans all applications.
The most straightforward solution would be to create your application and register it as the default browser.
Personally I would be annoyed by having to select a browser each time I click a link so I would probably make a helper application that when it starts remembers the current default browser and then registers the browser selector as the default. And when the helper closes it would restore the default browser.
My Java is quite rusty but I think this should be possible in either language. Maybe a little trickier in Java due to the lack of a dedicated executable for your application.
For C#:
This will open the url in the default browser:
string url = "http://google.com/";
System.Diagnostics.Process.Start(url);
This will open the url in the specified browser:
System.Diagnostics.Process.Start(#"C:\Program Files\Mozilla Firefox\firefox.exe", url);
There will be an error if the browser does not exist.
I have a general question about selenium:
Is there a way to run selenium webdriverv2 using java, in different browsers(chrome\firefox\safari...) without opening any browser?
I read about selenium grid, unfortunate in grid it open the browsers/machines.
If you dont want to open a browser, then Selenium isnt for you. If you want headless testing my suggestion would be to look into CasperJS.
I don't use Selenium for 6 month, but when I used it, it was necessary to open the browser and I think still being like that today.
Are java applets capable of opening new browser windows and retrieving their end URL?
Are java applets capable of opening new browser windows and retrieving their end URL?
No, and it is really none of the applet's business. It is a security thing.
Imagine you control an applet that opens an innocuous window. I get bored with that and reuse the window to surf over to BigBustyBabes.com instead. That final URL is not something I (as a user) would want your applet to know.
This link might help with opening a new URL, but from the same browser window. However assuming that you can reach the path where a browser is, you could easily run it. However I think this can be done easier with javascript, at least the part with retrieving the end URL, javascript seems to be the solution.
For opening a new window with javascript: window.open(URL,name,specs,replace).
For retrieving a URL with javascript use document.URL
How to develop a user defined plugin for a web browser.
It should features:
It should be installed in any browsers.
It should be executed whenever the browser starts.
It should monitor the web page and access the web page that the browser displays.
It should monitor and access the web page (for example, getting a value from a text box) irrespective of the web page the browser displays. (The web page can be of any URL either google or any domain)
How to start with it? It would be helpful if there is some sample. Thanks in advance
For Firefox < 4 write an Addon, for 4 and above Jetpack will be the way to go. For Chrome write a Extension. Opera, well wait till 11.5 ships. Safari 5. IE.
Read the documentation for each browser.
Hm...
I hope you tell the user about that.
Right now it reads like you want to deploy something to a PC and monitor all browsers, well if you want to do that you'll have to put some effort into it.
I don't think 1. is possible, you will have to create multiple versions of your plugin in order to work with each browser.
There is not a single example, because as I mentioned, you are going to have to do something different. You will need to determine and target specific browsers. I would suggest starting with one and once you have it have it working move to the next browser.
Do you mean a Plugin (like Flash, PDF Reader) or and Extension?
Plugins are native programs and extensions are normally coded in JavaScript & HTML.
Depending on what you want to do, an extension is enough powerful and the better choice.
There is no browser independent way to implement plugins. For each browsers you must read the interface reference. For example the reference for chrome: http://code.google.com/chrome/extensions/getstarted.html
I have found a solution to get the full file path of a file that is about to be uploaded using a Java Applet. I need this for an internal system not anything else "dodgy"!
Can anyone confirm if this works in an IE6 browser: http://www.maschek.hu/preview/ffx3_file/filepath.html
I have an IETester application that has IE6/7/8 in one place and all IE6 does is just load/wait for the page and it has been 10 minutes. I am trying to determine if this applet will work in IE6?
Its using PARAM tags so is that a no? This has worked on my IE8.
To get this to work, do I need to do more than change the PARAM tags to Object tags?
Thanks all
Check out this website -->
http://www.spoon.net/browsers/
Its a browser Sandbox. You can run any browser from the web. Very useful stuff.
If you want to test your application in IE6 you could use the Internet Explorer Application Compatibility Virtual PC Images supplied free by Microsoft. This will probably be more reliable than asking other people to do it for you.