In the below code on 33rd line getting below error message near wait.until
Multiple markers at this line - The type com.google.common.base.Function cannot be resolved. It is indirectly referenced from required .class files - The method until(Function) in the type FluentWait is not applicable for the arguments (ExpectedCondition)
package MPA;
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.WebDriverWait;
public class LoginhelperClass {
WebDriver driver;
@FindBy(xpath = "//input[@ng-model='login.username']")
private WebElement userName;
@FindBy(xpath = "//input[@type='password']")
private WebElement Password;
@FindBy(xpath = "//input[@type='submit' and @value='Sign In']")
private WebElement SignIn;
@FindBy(xpath = "//span[@class='icon-avatar-round']")
private WebElement Avatar;
public LoginhelperClass(WebDriver driver) {
this.driver = driver;
PageFactory.initElements(driver, this);
}
public void logIn(String uName, String Pswd) throws InterruptedException {
WebDriverWait wait=new WebDriverWait(driver,7);
wait.until(ExpectedConditions.visibilityOf(userName));
userName.sendKeys(uName);
Password.sendKeys(Pswd);
SignIn.click();
try {
Thread.sleep(4000);
if (Avatar.isDisplayed()) {
System.out.println("Login Successfull: " + uName);
} else {
System.out.println("Login failure check the credentials: " + uName);
}
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
}
package MPA;
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.WebDriverWait;
public class LoginhelperClass {
WebDriver driver;
@FindBy(xpath = "//input[@ng-model='login.username']")
private WebElement userName;
@FindBy(xpath = "//input[@type='password']")
private WebElement Password;
@FindBy(xpath = "//input[@type='submit' and @value='Sign In']")
private WebElement SignIn;
@FindBy(xpath = "//span[@class='icon-avatar-round']")
private WebElement Avatar;
public LoginhelperClass(WebDriver driver) {
this.driver = driver;
PageFactory.initElements(driver, this);
}
public void logIn(String uName, String Pswd) throws InterruptedException {
WebDriverWait wait=new WebDriverWait(driver,7);
wait.until(ExpectedConditions.visibilityOf(userName));
userName.sendKeys(uName);
Password.sendKeys(Pswd);
SignIn.click();
try {
Thread.sleep(4000);
if (Avatar.isDisplayed()) {
System.out.println("Login Successfull: " + uName);
} else {
System.out.println("Login failure check the credentials: " + uName);
}
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
}