Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8937483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:25:25+00:00 2026-06-15T10:25:25+00:00

I’ve been browsing around trying to find a solution to this but none of

  • 0

I’ve been browsing around trying to find a solution to this but none of the solutions have worked for me thus far.

Here is a quick test I’ve thrown together where its simply trying to click the ‘close’ button to close a modal pop up. I can step through my test in Visual Studio and it will work fine. When I run the test in Nunit, it will error. I’ve tried the following based upon others issues and suggestions given to them:-

  • putting in waits all over the place
  • changing from the chrome driver to firefox
  • changing to maximised window mode
  • re-working it every which way I can think of

The modal is not an iframe or anything like that. I seem to be getting the following error:

Exception has been thrown by the target of an invocation.
—-> System.InvalidOperationException : Element is not clickable at point (922.5, 342.0999755859375). Other element would receive the click:

which is why I was fiddling with maximised and normal sized modes.

Looking for any suggestions as it’s got me stumped..

Thanks

[Test(Description = "Test to check if the cancel button closes the modal window when clicked on the 'Reset Password' modal")]
    public void CheckCancelPasswordResetOnModalWorks()
    {
        bool modalFoundSuccess = false;
        bool forgotPasswordControlFound = false;
        _driver.Navigate().GoToUrl(_baseURL + "login");

        if (_loginPage.CheckForgotPasswordControlExists())
        {
            forgotPasswordControlFound = true;

            _loginPage.ClickForgotPasswordButton();

            if (_loginPage.CheckResetPasswordModalIsDisplayed())
            {
                modalFoundSuccess = true;
                _loginPage.ClickCancelResetPasswordButton();
                if (_loginPage.CheckResetPasswordModalIsDisplayed() != true)
                {
                    modalFoundSuccess = false;
                }
                Assert.IsFalse(modalFoundSuccess, "The modal window did not close when the 'cancel' button was clicked on the modal pop up");
            }
            Assert.IsTrue(forgotPasswordControlFound, "Could not find the 'Forgotten Password' Modal box on the page");
        }
        Assert.IsTrue(forgotPasswordControlFound, "Was not able to find the 'Forgot Password' button on the '/login' page.");
    }

Page Item

public class LoginPage : Page
{
    private IWebDriver _driver;
    public string userNameValidationText = "Username must be filled in.";
    public string passwordValidationText = "Password must be filled in.";
    public string incorrectLoginValidationText = "The user name or password is incorrect";

    [FindsBy(How = How.ClassName, Using = "scfForm")]
    private IWebElement _WFFMForm;

    [FindsBy(How = How.XPath, Using = "//div[@class='scfSubmitButtonBorder']/input")]
    private IWebElement _loginButton;

    [FindsBy(How = How.XPath, Using = "//div[@class='scfSingleLineGeneralPanel']/input")]
    private IWebElement _userNameField;

    [FindsBy(How = How.XPath, Using = "//div[@class='scfPasswordGeneralPanel']/input")]
    private IWebElement _passwordField;

    [FindsBy(How = How.XPath, Using = "//div[@id='divForgotPassword']")]
    private IWebElement _resetPasswordModal;

    [FindsBy(How = How.XPath, Using = "//div[@id='divForgotPassword']/p/input")]
    private IWebElement _forgotPasswordEmailInputField;

    [FindsBy(How = How.XPath, Using = "//div[@id='divForgotPassword']/a[contains(., 'Reset My Password')]")]
    private IWebElement _resetPasswordButton;

    [FindsBy(How = How.XPath, Using = "//div[@id='divForgotPassword']/a[contains(., 'Cancel')]")]
    private IWebElement _cancelResetPasswordButton;

    [FindsBy(How = How.XPath, Using = "//div[@class='forgot-password']/a[contains(., 'Forgot Password')]")]
    private IWebElement _forgotPasswordButton;

    public LoginPage(IWebDriver driver)
        : base(driver)
    {
        _driver = driver;
        PageFactory.InitElements(_driver, this);
    }

    public void InputUserNameText(string phoneText)
    {
        _userNameField.Clear();
        _userNameField.SendKeys(phoneText);
    }

    public void InputPasswordText(string queryText)
    {
        _passwordField.Clear();
        _passwordField.SendKeys(queryText);
    }

    public void InputResetPasswordEmail(string resetEmail)
    {
        _forgotPasswordEmailInputField.Clear();
        _forgotPasswordEmailInputField.SendKeys(resetEmail);
    }

    public void ClickLoginButton()
    {
        _loginButton.Click();
    }

    public void ClickResetButton()
    {
        WebDriverWait wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(10));
        wait.Until((d) => { return CheckModalHasLoaded(); });
        _resetPasswordButton.Click();
    }

    public void ClickCancelResetPasswordButton()
    {
        WebDriverWait wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(20));
        wait.Until((d) => { return CheckModalHasLoaded(); });
        _cancelResetPasswordButton.Click();
    }

    public void ClickForgotPasswordButton()
    {
        _forgotPasswordButton.Click();
    }

    public void ClickLoginButtonForEmtpyValidation()
    {
        _loginButton.Click();
        WebDriverWait wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(10));
        wait.Until((d) => { return CheckValidationTopBoxExists(); });
    }

    public bool CheckValidationForIncorrectLoginExists()
    {
        return Utility.IsThisElementPresent(_driver, By.XPath("//div[@class='scfSubmitSummary']/span"));
    }

    public bool loginFormExistsCheck()
    {
        return Utility.IsThisElementPresent(_driver, By.ClassName("scfForm"));
    }

    public bool CheckValidationTopBoxExists()
    {
        return Utility.IsThisElementPresent(_driver, By.ClassName("scfValidationSummary"));
    }

    public bool CheckResetPasswordModalIsDisplayed()
    {
        return Utility.IsThisElementPresent(_driver, By.XPath("//div[@id='divForgotPassword']"));
    }

    public bool CheckForgotPasswordControlExists()
    {
        return Utility.IsThisElementPresent(_driver, By.ClassName("forgot-password"));
    }

    public bool CheckModalHasLoaded()
    {
        return Utility.IsThisElementPresent(_driver, By.XPath("//div[@id='divForgotPassword']"));
    }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:25:26+00:00Added an answer on June 15, 2026 at 10:25 am

    If the modal is already in the DOM(ie. not loaded via ajax) you may need to change it to wait for element visible (assuming the modal is hidden). This is because the element is present always, just not visible. This explains why it works when you step through it in debug mode also.

    Try using something like

    WebDriverWait wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(10));
    wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("//div[@id='ElementYouWantToTarget']")));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
This could be a duplicate question, but I have no idea what search terms
I have a jquery bug and I've been looking for hours now, I can't
Seemingly simple, but I cannot find anything relevant on the web. What is the
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have been unable to fix a problem with Java Unicode and encoding. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.