Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Click doesn't work if the element has border-radius set and it's partially covered by another element (2.51.0+) #2497

Closed
abasau opened this issue Jul 20, 2016 · 3 comments

Comments

@abasau
Copy link

abasau commented Jul 20, 2016

Meta -

OS:
Windows 7

Selenium Version:
2.51.0+

Browser:
Firefox

Browser Version:
Firefox 44.0.2+

Expected Behavior -

An element should be click or an exception should be raised if it's partially covered.

Actual Behavior -

The click was performed outside the element.

Steps to reproduce -

The issue is probably caused by 65dbe9a and is reproducible when the element has 'border-radius' set, its middle point is covered by another element, and some corner points are not covered. It clicks point that doesn't belong to the element. As a result the element is not clicked and the exception is not raised.

I have also seen the issue in cases when the element didn't have border-radius set. In that cases WebDriver clicked one pixel right from lower right corner.

jsfiddle - https://jsfiddle.net/aliaksandr_basau/tve0sf2w/
Code:

    [TestFixture]
    public class Tests
    {
        [Test]
        public void Verify()
        {
            using (var driver = new FirefoxDriver())
            {
                try
                {
                    driver.Navigate().GoToUrl("https://jsfiddle.net/aliaksandr_basau/tve0sf2w/embedded/result/");

                    driver.SwitchTo().Frame(0);

                    driver.ExecuteScript("window.scrollBy(0,990)");

                    var searchBtn = driver.FindElement(By.ClassName("btn"));

                    searchBtn.Click();

                    IAlert alert = null;
                    try
                    {
                        alert = driver.SwitchTo().Alert();
                    }
                    catch (NoAlertPresentException)
                    {
                    }

                    if (alert != null)
                    {
                        alert.Accept();
                    }

                    Assert.NotNull(alert, "The button was not clicked.");
                }
                finally
                {
                    driver.Close();
                    driver.Quit();
                }
            }
        }
    }
@lukeis
Copy link
Member

lukeis commented Jul 22, 2016

thanks for the excellent reproduction script!

@lukeis lukeis closed this as completed in 23a24f5 Jul 22, 2016
@abasau
Copy link
Author

abasau commented Jul 22, 2016

Many thanks for so quick fixing, @lukeis! Do you know when to expect a new release with the fix?

@lukeis
Copy link
Member

lukeis commented Jul 22, 2016

not certain when, we're working toward a release of 3.0 beta... which you can try out an 'alpha' here:
http://ci.seleniumhq.org:8080/job/Build_All_Java/lastSuccessfulBuild/artifact/selenium-server-standalone-latest.jar

keep in mind, GeckoDriver is default now in 3.0, you'll have to set the Capability "marionette": false if you want to use the 'old' Firefox Driver

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants