-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHomePage.java
More file actions
37 lines (30 loc) · 1.01 KB
/
HomePage.java
File metadata and controls
37 lines (30 loc) · 1.01 KB
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
package hackthon;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.testng.Assert;
public class HomePage {
WebDriver driver;
public HomePage(WebDriver driver) {
this.driver=driver;
}
By logo=By.xpath("//div[@class='header-logo']");
By Register=By.xpath("//a[@class='ico-register']");
By banner=By.xpath("//img[@class='nivo-main-image']");
public void TitleandUrl() {
Assert.assertEquals(driver.getTitle(), "Demo Web Shop");
Assert.assertEquals(driver.getCurrentUrl(), "https://demowebshop.tricentis.com/");
}
public void Logocheck() {
WebElement Logo=driver.findElement(logo);
Assert.assertTrue(Logo.isDisplayed());
}
public void TextRegister() {
WebElement Registervisible=driver.findElement(Register);
Assert.assertTrue(Registervisible.isDisplayed());
}
public void Bannervisible() {
WebElement Banner=driver.findElement(banner);
Assert.assertTrue(Banner.isDisplayed());
}
}