-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGoogleSearchChoucairtesting.java
48 lines (33 loc) · 1.11 KB
/
GoogleSearchChoucairtesting.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.choucairtesting;
import static org.junit.Assert.assertEquals;
import java.util.concurrent.TimeUnit;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class GoogleSearchChoucairtesting{
private WebDriver driver;
@Before
public void setUp() {
System.setProperty("webdriver.chrome.driver", "./src/test/resources/chromedriver/chromedriver.exe");
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.get("https://www.google.com/");
}
@Test
public void testChoucairtestingPage() {
WebElement searchbox = driver.findElement(By.name("q"));
searchbox.clear();
searchbox.sendKeys("Pruebas de software centradas en su negocio");
searchbox.submit();
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
assertEquals("Pruebas de software centradas en su negocio - Google Search", driver.getTitle());
}
@After
public void tearDonw() {
driver.quit();
}
}