forked from TalhaBinAshraf1/SeleniumTestingInternetHerokuApp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasicAuth.java
More file actions
24 lines (19 loc) · 771 Bytes
/
Copy pathBasicAuth.java
File metadata and controls
24 lines (19 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package allTests;
import static org.testng.Assert.assertEquals;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;
import utility.BaseTest;
import utility.FrameworkConstants;
public class BasicAuth {
@Test
public void test() throws InterruptedException {
System.setProperty(FrameworkConstants.CHROME_DRIVER_KEY,FrameworkConstants.CHROME_DRIVER_PATH);
WebDriver driver = new ChromeDriver();
driver.get("http://admin:admin@the-internet.herokuapp.com/basic_auth/");
driver.get("http://the-internet.herokuapp.com/basic_auth");
String pageMessage = driver.findElement(By.cssSelector("p")).getText();
assertEquals(pageMessage, "Congratulations!");
}
}