java program to open a web page in browser and post some data into the opened page -


i m stuck problem. problem want write java code opens web page in default browser , post data opened web page.

please guide me this. dont have clue in this.

your appreciated. in advance

you need web driver this. @ selenium

i pasting code getting started selenium

package org.openqa.selenium.example;  import org.openqa.selenium.by; import org.openqa.selenium.webdriver; import org.openqa.selenium.webelement; import org.openqa.selenium.htmlunit.htmlunitdriver;  public class example  {     public static void main(string[] args) {     // create new instance of html unit driver     // notice remainder of code relies on interface,      // not implementation.     webdriver driver = new htmlunitdriver();      // , use visit google     driver.get("http://www.google.com");      // find text input element name     webelement element = driver.findelement(by.name("q"));      // enter search     element.sendkeys("cheese!");      // submit form. webdriver find form element     element.submit();      // check title of page     system.out.println("page title is: " + driver.gettitle());      driver.quit(); } } 

this example shows how can open google.com , type search text , click search button.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -