33 lines
875 B
Java
33 lines
875 B
Java
package page;
|
|
|
|
import org.openqa.selenium.WebDriver;
|
|
import org.openqa.selenium.WebElement;
|
|
import org.openqa.selenium.support.FindBy;
|
|
|
|
public class LegislationPage {
|
|
WebDriver driver;
|
|
|
|
@FindBy(xpath = "//*[@id=\"MainContent\"]/table[8]/tbody/tr[2]/td/ul/li")
|
|
private WebElement downloadLink;
|
|
|
|
@FindBy(xpath = "//*[@id=\"4e4a4b91-915e-4759-ad51-5daa9292f5aa\"]/div/div/table/tbody/tr[1]/td[3]/a")
|
|
private WebElement downloadDoc;
|
|
|
|
public LegislationPage(WebDriver driver) {
|
|
this.driver = driver;
|
|
}
|
|
|
|
public String getFileName(){
|
|
String fileName = downloadDoc.getAttribute("href");
|
|
fileName = fileName.substring(fileName.lastIndexOf("/")+1);
|
|
return fileName;
|
|
}
|
|
|
|
public void clickDownloadDocLink() {
|
|
downloadLink.click();
|
|
}
|
|
|
|
public void clickDownload() {
|
|
downloadDoc.click();
|
|
}
|
|
} |