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
Post a Comment