How to open URL in Chrome Browser using Selenium Webdriver

Below code is for opening a URL in google chrome by selenium webdriver. (for more information check the comment text in the code).











package mypackage;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class Signup {

 public static void main(String[] args) {
  // TODO Auto-generated method stub

  //path of chrome driver and set property to your chrome driver
 String exepath = "C:\\Users\\abc\\Downloads\\chromedriver_win32//chromedriver.exe";
 System.setProperty("webdriver.chrome.driver", exepath);
 
  WebDriver driver = new ChromeDriver();
  
  //launch chrome and direct it to the URL
  driver.get("http://www.testingtreasure.com");
  
  //maximize window
  driver.manage().window().maximize();
  
  //close browser
  driver.close();
  
 }

}





20 comments:

  1. Very useful article.Some valuable tips on how to open URL in Google Chrome Help browser.Waiting for new updates.

    ReplyDelete
  2. Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.selenium training in bangalore

    ReplyDelete
  3. By watching this now I have cleared all my doubts on How to open URL in Chrome Browser using Selenium Web driver.
    For Selenium Online Training | Selenium Training

    ReplyDelete
  4. Nice post.. Really you are done a wonderful job.thank for sharing such a wonderful information with us..please keep on updating..
    Best cloud Computing Training Institute in Chennai | Best cloud Computing Training Institute in Velachery

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. amazing blog. This is really more effective and informative blog. I like it! Thanks for sharing!
    Best Microsoft Azure Training Institute in Chennai |Best Microsoft Azure Training Institute Velachery

    ReplyDelete
  7. Interesting and Nice article, thanks for sharing your information and valuable time.... keep on rocks....
    MCA Project Center in Chennai | MCA Project Center in Velachery

    ReplyDelete
  8. Excellent blog! The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
    Summer Course for Computer Science in Medavakkam | Summer Course for Computer Science in Tambaram | Summer Courses for Computer Science in Velachery

    ReplyDelete
  9. Very Useful information that i have found. don't stop and Please keep updating us..... Thanks
    Summer Courses for Android in Perungudi | Summer Courses for IOS in Velachery | Summer Courses in OMR

    ReplyDelete
  10. Impressive blog with lovely information. really very useful article for us thanks for sharing such a wonderful blog...
    Summer Courses in Perungudi | Summer Courses in OMR | Summer Courses in Velachery

    ReplyDelete
  11. Extraordinary blog. you put Good stuff. All the themes were clarified briefly.Thanks for sharing that post.Keep in blogging…
    Summer Courses in Adyar | Summer Courses in OMR | Summer Courses in Velachery

    ReplyDelete
  12. Great blog.you put Good stuff.All the topics were explained briefly.so quickly understand for me.I am waiting for your next fantastic blog.Thanks for sharing.
    Summer Courses for Android in Perungudi | Summer Courses for IOS in Velachery | Summer Courses in OMR

    ReplyDelete

  13. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information, this is useful to me…
    Summer Camp for Kids in Chennai | Summer courses in Shozhinganallur | Summer classes in Chennai

    ReplyDelete
  14. This is great information for youngsters those really seeking for the updated technology and thanks for the valuable post...No.1 Summer Training Courses in Porur | Best Summer Courses for Hardware Networking in Chennai

    ReplyDelete
  15. Wow superb...Thank you for sharing the fantastic article,keep updating such a interesting post..
    Best Summer Courses for Hardware and Networking in Chennai | No.1 Vacation Classes in Guindy

    ReplyDelete
  16. Nice Post,But need to do some modification any how good content Keep on updating the content

    ReplyDelete
  17. Its Very Good Information I Clarified How to open URL in Web Browser Thanks for Sharing..,

    Best Software Training Institute in Chennai

    Best Online Training Institute in Chennai

    ReplyDelete