Summary Table

Categories Total Count
PII 0
URL 0
DNS 1
EKL 0
IP 0
PORT 0
VsID 0
CF 0
AI 0
VPD 0
PL 0
Other 0

File Content

package po;

import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.Select;
import org.openqa.selenium.support.ui.WebDriverWait;

public class LoginPO {
WebDriver driver;

public LoginPO(WebDriver driver){
this.driver = driver;
PageFactory.initElements(driver, this);
}

@FindBy(id = "userName")
private WebElement selectUserNameDrp;

@FindBy(id = "loginAdminBtn")
private WebElement acceptBtn;

@FindBy(xpath = "//option[@value ='
DNS ']")
private WebElement optionDrp;

@FindBy(xpath = "//button[@type='submit']")
private WebElement submitBtn;


public void selectUserNameDropDown(String userName){
WebDriverWait wait = new WebDriverWait(driver,25);
wait.until(ExpectedConditions.visibilityOf(optionDrp));
Select select = new Select(selectUserNameDrp);
select.selectByValue(userName);
}

public void acceptBtnClick(){
acceptBtn.click();
}

public void submitBtnClick(){
WebDriverWait wait = new WebDriverWait(driver,25);
wait.until(ExpectedConditions.visibilityOf(submitBtn));
JavascriptExecutor executor = (JavascriptExecutor)driver;
executor.executeScript("arguments[0].click();", submitBtn);


}


}