jeudi 5 octobre 2017

Selenium ChromeDriver c# - Not working Click

I am working with Selenium to do some tests in my application and the functions which are using the method "Click" are not working fine since two days ago.

For example, the simple function to check the login:

public LoginConnect() : base() { }

    #region pageElements
    [FindsBy(How = How.Id, Using = "userNameInput")]
    public IWebElement userId { get; set; }

    [FindsBy(How = How.Id, Using = "userPasswordInput")]
    public IWebElement password { get; set; }

    [FindsBy(How = How.Id, Using = "LoginButton")]
    public IWebElement loginButton { get; set; }

    #endregion

    #region pageActions
    public JobList LogConnect(String userId, String password)
    {            
        CleanFormConnect();
        this.userId.SendKeys(userId);
        this.password.SendKeys(password);            
        this.loginButton.Click();
        return new JobList();
    }

}

It's not working fine. There is no errors in the function Click, but the browser doesn't do anything.

The version of Chrome is Versión 61.0.3163.100 The version of Driver is 2.33

If I change the function

this.loginButton.Click();

for

this.loginButton.SendKeys(Keys.Return);

It works as expected.

Aucun commentaire:

Enregistrer un commentaire