0
//@Test(priority=8)
public void reset_psw()
{
    LoginPage login=new LoginPage(driver);
    driver.findElement(By.xpath("//*[@id='app']/div/div[2]/a")).click();        
    WebDriverWait wait = new WebDriverWait(driver, 10);
    wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@id='app']/div/div[2]/form/div[3]/div[2]/button[contains(text(),'Send Password Reset Link')]")));
    String expectedTitle = "Placer Admin - Password recovery";
    String actualTitle = driver.getTitle();
    login.equal_titles(actualTitle, expectedTitle);
    driver.navigate().refresh();
}

@Test(priority=9)
public void reset_email()
{
    LoginPage login=new LoginPage(driver);
    driver.findElement(By.xpath("//*[@id='app']/div/div[2]/a")).click();
    WebDriverWait wait = new WebDriverWait(driver, 60);
    wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@id='app']/div/div[2]/form/div[3]/div[2]/button[contains(text(),'Send Password Reset Link')]")));
    /*login.set_reset_email("");
    login.click_reset_button(); 
    WebDriverWait wait_reset_psw = new WebDriverWait(driver, 10);
    wait_reset_psw.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@id='app']/div/div[2]/form/div[2]/span[2]")));
    Assert.assertEquals(driver.findElement(By.xpath("//*[@id='app']/div/div[2]/form/div[2]/span[2]")).getText(),"The email field is required.");*/
    driver.navigate().refresh();
}       
@AfterTest
public void close()
{
    driver.close();
}

This is part of my code.When I run these two separately,It is running without any error.But when I try to run these two at once with priority it is showing error as follows,

PASSED: reset_psw

FAILED: reset_email

org.openqa.selenium.TimeoutException: Expected condition failed: waiting for visibility of element located by By.xpath: //*[@id='app']/div/div[2]/form/div[3]/div[2]/button[contains(text(),'Send Password Reset Link')] (tried for 60 second(s) with 500 MILLISECONDS interval)

Login page showing 60 secs without making click on link which I want.

How to solve this error? Please help me to find this problem...

Community
  • 1
  • 1
user3806999
  • 39
  • 4
  • 14
  • Possible duplicate of [Expected condition failed: waiting for visibility of element located by By.xpath](https://stackoverflow.com/questions/44920201/expected-condition-failed-waiting-for-visibility-of-element-located-by-by-xpath) – LMC May 02 '18 at 15:59
  • I have tried with presence of element,but it also not working.And then I have tried follow code, – user3806999 May 03 '18 at 06:13
  • wait.until(ExpectedConditions.visibilityOfElementLocated(By.linkText("Tehingud"))); WebElement ele = wait.until(ExpectedConditions.elementToBeClickable(By.linkText("Tehingud"))); Thread.sleep (1000); ele.click(); – user3806999 May 03 '18 at 06:14
  • This also not working.Please help me to find a solution for this...Thanks in advance – user3806999 May 03 '18 at 06:15

0 Answers0