import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeDriverService;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import java.io.File;
import java.io.IOException;
public class SimpleTest {
public static void main(String args[]) throws IOException {
ChromeDriverService service = new ChromeDriverService.Builder().usingDriverExecutable(new File("C:\\seleniumdrivers\\chromedriver.exe")).usingAnyFreePort().build();
service.start();
WebDriver driver = new ChromeDriver(service,new DesiredCapabilities().chrome());
System.out.println("First Driver Session id -- "+((RemoteWebDriver)driver).getSessionId());
driver.get("http://www.seleniumframework.com");
System.out.println("Title-"+driver.getTitle());
driver.close();
driver = new ChromeDriver(service,new DesiredCapabilities().chrome());
System.out.println("Second Driver Session id -- "+((RemoteWebDriver)driver).getSessionId());
driver.get("http://automationpractice.com");
System.out.println("Automation practice title-"+driver.getTitle());
driver.close();
service.stop();
}
}
--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+...@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.
Visit this group at http://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/d/optout.