How can I open IE from java and perform operations like click () etc. Through java?
I suggest using a testing framework like HtmlUnit . Even with this for testing purposes, it's a great software "navigator" of remote websites.
Here's a sample code from the site showing how to navigate to a page and fill out a form:
public void submittingForm() throws Exception {
WebClient webClient = new WebClient();
HtmlPage page1 = webClient.getPage("http://some_url");
HtmlForm form = page1.getFormByName("myform");
HtmlSubmitInput button = form.getInputByName("submitbutton");
HtmlTextInput textField = form.getInputByName("userid");
textField.setValueAttribute("root");
HtmlPage page2 = button.click();
}
source to share
You can start it with
Runtime.getRuntime().exec("command-line command to launch IE");
then use Java Robot class to send mouse clicks and fill text. This seems rather crude, however, and you can probably do better by contacting the web server directly (bypassing the browser entirely).
source to share
The answer to this question might be helpful.
But you should consider direct HTTP as the best way to interact with websites.
source to share
If you really want "real" IE you can try Watij , if you only want browser features in java I recommend HttpClient
Update: Since the OP shown using a real browser is unnecessary / unnecessary. An example of form login using HttpClient can be found here: http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientFormLogin.java
source to share