Advertisement
SeleniumETrainR

How to use the HtmlUnit driver with Selenium webdriver throu

Dec 12th, 2012
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. import org.openqa.selenium.htmlunit.HtmlUnitDriver;
  2.  
  3. public class testHtmlUnitDriver {
  4.  
  5.  
  6. public static void main(String[] args) {
  7. HtmlUnitDriver myDriver = new HtmlUnitDriver();
  8.  
  9.  
  10. myDriver.get("http://twitter.com");
  11.  
  12. System.out.println("What is my URL --------------->" + myDriver.getCurrentUrl());
  13.  
  14. System.out.println("What is my Page title ----------->" + myDriver.getTitle());
  15.  
  16. System.out.println("");
  17. myDriver.quit();
  18.  
  19. }
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement