单击按钮仅适用于调试器

clicking on a button is working only with debugger

我有一个按钮,我想点击它,
当我 运行 通常测试他不是 "clicked"
当我 运行 使用调试器进行测试时,一切正常

我将 implicitlyWait 设置为 30 秒,即使我更改它也没有任何区别,
我的问题是当我点击 "Next" 按钮时

这是站点代码:

<div class="b24-network-auth-form-btn-block">
    <input style="display: none;" name="login" value="user">
    **<button class="ui-btn ui-btn-md ui-btn-success ui-btn-round b24-network-auth-form-btn" data-action="submit">Next</button>**
    <button class="ui-btn ui-btn-md ui-btn-light ui-btn-round b24-network-auth-form-btn" data-action="forgot">Forgot password?</button>
</div>

这是我的测试:

public class LoginPage extends Base
{           
   @FindBy(id="login")      
   public WebElement txtUserName; //user name
   @FindBy(xpath="/html//div[@id='authorize-layout']/div/div[3]//form//button[.='Next']")
   public WebElement btnNext; //"next" button
   @FindBy(id="password")
   public WebElement txtPassword;   //password

  public void login(String sUser, String sPass) throws ParserConfigurationException, SAXException, IOException
  {
        Update.text(txtUserName,"User Name",sUser);         //type the user name
        Click.click(btnNext, "Next button");                //click the "next" button
        Update.text(txtPassword, "Password", sPass);        //type the "password" button
        Click.click(btnNext, "Next button");                //click the "next" button
  }
}

这意味着有等待问题。

稍等片刻:

    WebDriverWait wait = new WebDriverWait(driver, 60);
    wait.until(ExpectedConditions.visibilityOfElementLocated(By.""""""));
    wait.until(ExpectedConditions.elementToBeClickable((By.""""""));

在上面的代码中输入您的按钮定位器