First Test Case with 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;

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("", exepath);
  WebDriver driver = new ChromeDriver();
  //launch chrome and direct it to the URL
  //maximize window
  //close browser


No comments:

Post a Comment