Java Code Examples for org.openqa.selenium.chrome.ChromeDriver#get()

The following examples show how to use org.openqa.selenium.chrome.ChromeDriver#get() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SystemPerformanceDemo.java    From query2report with GNU General Public License v3.0 6 votes vote down vote up
@BeforeClass
public static void init(){
	driver = new ChromeDriver();
	driver.manage().window().maximize();
	driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);
	driver.manage().timeouts().pageLoadTimeout(30,TimeUnit.SECONDS);
	try{
		driver.get("http://localhost:8080/q2r/login.html");
		Thread.sleep(1000);
		driver.findElement(By.id("username")).sendKeys("admin");
		driver.findElement(By.id("password")).sendKeys("admin");
		driver.findElement(By.id("loginButton")).click();
		Thread.sleep(1000);
	}catch(Exception e){
		e.printStackTrace();
	}
}
 
Example 2
Source File: ReportShowCaseDemo.java    From query2report with GNU General Public License v3.0 6 votes vote down vote up
@BeforeClass
public static void init(){
	driver = new ChromeDriver();
	driver.manage().window().maximize();
	driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);
	driver.manage().timeouts().pageLoadTimeout(30,TimeUnit.SECONDS);
	try{
		driver.get("http://localhost:8080/q2r/login.html");
		Thread.sleep(1000);
		driver.findElement(By.id("username")).sendKeys("admin");
		driver.findElement(By.id("password")).sendKeys("admin");
		driver.findElement(By.id("loginButton")).click();
		Thread.sleep(1000);
	}catch(Exception e){
		e.printStackTrace();
	}
}
 
Example 3
Source File: BuildingReportTestCases.java    From query2report with GNU General Public License v3.0 6 votes vote down vote up
@BeforeClass
public static void init(){
	driver = new ChromeDriver();
	driver.manage().window().maximize();
	driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);
	driver.manage().timeouts().pageLoadTimeout(30,TimeUnit.SECONDS);
	try{
		driver.get("http://localhost:8080/q2r/login.html");
		Thread.sleep(1000);
		driver.findElement(By.id("username")).sendKeys("admin");
		driver.findElement(By.id("password")).sendKeys("admin");
		driver.findElement(By.id("loginButton")).click();
		Thread.sleep(1000);
	}catch(Exception e){
		e.printStackTrace();
	}
}
 
Example 4
Source File: CurrencyConversion.java    From query2report with GNU General Public License v3.0 6 votes vote down vote up
@BeforeClass
public static void init(){
	driver = new ChromeDriver();
	driver.get("chrome://settings/");
	driver.manage().window().maximize();
	driver.manage().window().fullscreen();
	driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);
	driver.manage().timeouts().pageLoadTimeout(30,TimeUnit.SECONDS);
	try{
		driver.get("http://localhost:8080/q2r/login.html");
		Thread.sleep(1000);
		driver.findElement(By.id("username")).sendKeys("admin");
		driver.findElement(By.id("password")).sendKeys("admin");
		driver.findElement(By.id("loginButton")).click();
		Thread.sleep(1000);
	}catch(Throwable e){
		e.printStackTrace();
	}
}
 
Example 5
Source File: SalesDemo.java    From query2report with GNU General Public License v3.0 6 votes vote down vote up
@BeforeClass
public static void init(){
	driver = new ChromeDriver();
	driver.manage().window().maximize();
	driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);
	driver.manage().timeouts().pageLoadTimeout(30,TimeUnit.SECONDS);
	try{
		driver.get("http://localhost:8080/q2r/login.html");
		Thread.sleep(1000);
		driver.findElement(By.id("username")).sendKeys("admin");
		driver.findElement(By.id("password")).sendKeys("admin");
		driver.findElement(By.id("loginButton")).click();
		Thread.sleep(1000);
	}catch(Exception e){
		e.printStackTrace();
	}
}
 
Example 6
Source File: SearchTest.java    From Selenium-WebDriver-3-Practical-Guide-Second-Edition with MIT License 5 votes vote down vote up
@BeforeMethod
public void setup() {

    System.setProperty("webdriver.chrome.driver",
            "./src/test/resources/drivers/chromedriver");
    driver = new ChromeDriver();
    driver.get("http://demo-store.seleniumacademy.com/");

}
 
Example 7
Source File: ChromeWithGlobalOptionsJupiterTest.java    From selenium-jupiter with Apache License 2.0 5 votes vote down vote up
@Test
void webrtcTest(ChromeDriver driver) {
    driver.get(
            "https://webrtc.github.io/samples/src/content/devices/input-output/");
    assertThat(driver.findElement(By.id("video")).getTagName(),
            equalTo("video"));
}
 
Example 8
Source File: MultipleConfigWdmJupiterTest.java    From selenium-jupiter with Apache License 2.0 5 votes vote down vote up
@Test
void multipleConfigTest(ChromeDriver chrome, FirefoxDriver firefox) {
    String sut = "https://bonigarcia.github.io/selenium-jupiter/";
    String title = "JUnit 5 extension for Selenium";

    chrome.get(sut);
    firefox.get(sut);

    assertThat(chrome.getTitle(), containsString(title));
    assertThat(firefox.getTitle(), containsString(title));
}
 
Example 9
Source File: SearchTest.java    From Selenium-WebDriver-3-Practical-Guide-Second-Edition with MIT License 5 votes vote down vote up
@BeforeMethod
public void setup() {

    System.setProperty("webdriver.chrome.driver",
            "./src/test/resources/drivers/chromedriver");
    driver = new ChromeDriver();
    driver.get("http://demo-store.seleniumacademy.com/");

}
 
Example 10
Source File: SearchTest.java    From Selenium-WebDriver-3-Practical-Guide-Second-Edition with MIT License 5 votes vote down vote up
@BeforeMethod
public void setup() {

    System.setProperty("webdriver.chrome.driver",
            "./src/test/resources/drivers/chromedriver");
    driver = new ChromeDriver();
    driver.get("http://demo-store.seleniumacademy.com/");

}
 
Example 11
Source File: SearchTestWithDataProvider.java    From Selenium-WebDriver-3-Practical-Guide-Second-Edition with MIT License 5 votes vote down vote up
@BeforeMethod
public void setup() {

    System.setProperty("webdriver.chrome.driver",
            "./src/test/resources/drivers/chromedriver");
    driver = new ChromeDriver();
    driver.get("http://demo-store.seleniumacademy.com/");

}
 
Example 12
Source File: LoadCookieInfo.java    From Selenium-WebDriver-3-Practical-Guide-Second-Edition with MIT License 5 votes vote down vote up
@BeforeMethod
public void setup() throws IOException {
    System.setProperty("webdriver.chrome.driver",
            "./src/test/resources/drivers/chromedriver");
    driver = new ChromeDriver();
   driver.get("http://demo-store.seleniumacademy.com");
}
 
Example 13
Source File: FrameHandlingTest.java    From Selenium-WebDriver-3-Practical-Guide-Second-Edition with MIT License 5 votes vote down vote up
@BeforeMethod
public void setup() throws IOException {

    System.setProperty("webdriver.chrome.driver",
            "./src/test/resources/drivers/chromedriver");

    driver = new ChromeDriver();
    driver.get("http://guidebook.seleniumacademy.com/Frames.html");
}
 
Example 14
Source File: StoreCookieInfo.java    From Selenium-WebDriver-3-Practical-Guide-Second-Edition with MIT License 5 votes vote down vote up
@BeforeMethod
public void setup() throws IOException {
    System.setProperty("webdriver.chrome.driver",
            "./src/test/resources/drivers/chromedriver");
    driver = new ChromeDriver();
    driver.get("http://demo-store.seleniumacademy.com/customer/account/login/");
}
 
Example 15
Source File: ForceCacheJupiterTest.java    From selenium-jupiter with Apache License 2.0 4 votes vote down vote up
@Test
public void test(ChromeDriver driver) {
    driver.get("https://bonigarcia.github.io/selenium-jupiter/");
    assertThat(driver.getTitle(),
            containsString("JUnit 5 extension for Selenium"));
}
 
Example 16
Source File: SeleniumJupiterTest.java    From selenium-jupiter with Apache License 2.0 4 votes vote down vote up
@Test
public void testWithChrome(ChromeDriver driver) {
    driver.get("https://bonigarcia.github.io/selenium-jupiter/");
    assertThat(driver.getTitle(),
            containsString("JUnit 5 extension for Selenium"));
}
 
Example 17
Source File: ChromeWithOptionsJupiterTest.java    From selenium-jupiter with Apache License 2.0 4 votes vote down vote up
@Test
void headlessTest(@Arguments("--headless") ChromeDriver driver) {
    driver.get("https://bonigarcia.github.io/selenium-jupiter/");
    assertThat(driver.getTitle(),
            containsString("JUnit 5 extension for Selenium"));
}
 
Example 18
Source File: ChromeWithGlobalCapabilitiesJupiterTest.java    From selenium-jupiter with Apache License 2.0 4 votes vote down vote up
@Test
void chromeTest(ChromeDriver driver) {
    driver.get("https://bonigarcia.github.io/selenium-jupiter/");
    assertThat(driver.getTitle(),
            containsString("JUnit 5 extension for Selenium"));
}
 
Example 19
Source File: LocalWebDriverTest.java    From mastering-junit5 with Apache License 2.0 4 votes vote down vote up
@Test
public void testWithChrome(ChromeDriver chrome) {
    chrome.get("https://bonigarcia.github.io/selenium-jupiter/");

    assertTrue(chrome.getTitle().startsWith("Selenium-Jupiter"));
}
 
Example 20
Source File: ChromeJupiterTest.java    From selenium-jupiter with Apache License 2.0 4 votes vote down vote up
@Test
void testWithOneChrome(ChromeDriver driver) {
    driver.get("https://bonigarcia.github.io/selenium-jupiter/");
    assertThat(driver.getTitle(),
            containsString("JUnit 5 extension for Selenium"));
}