-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddtocartPage.java
More file actions
47 lines (33 loc) · 1.25 KB
/
AddtocartPage.java
File metadata and controls
47 lines (33 loc) · 1.25 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
38
39
40
41
42
43
44
45
46
47
package hackthon;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.Select;
public class AddtocartPage {
WebDriver driver;
public AddtocartPage(WebDriver driver) {
this.driver=driver;
}
By digital=By.xpath("(//a[@href='/digital-downloads'])[1]");
By PriceFilter=By.id("products-orderby");
By Addtocatbutton=By.xpath("(//input[@class='button-2 product-box-add-to-cart-button'])[1]");
By Addtocatbutton1=By.xpath("(//input[@class='button-2 product-box-add-to-cart-button'])[2]");
By shopingbutton= By.linkText("Shopping cart");
public void DigitalDownload() {
driver.findElement(digital).click();
}
public void PriceFilterApply() {
WebElement price=driver.findElement(PriceFilter);
Select select=new Select(price);
select.selectByIndex(4);
}
public void AddtocatClick() {
driver.findElement(Addtocatbutton).click();
}
public void Addtocartclick1() {
driver.findElement(Addtocatbutton1).click();
}
public void ShopingbiuttonClick() {
driver.findElement(shopingbutton).click();
}
}