Skip to content
New issue

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

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

Already on GitHub? # to your account

PhantomJS: Can't click a button #140

Open
Sebazzz opened this issue Feb 26, 2015 · 0 comments
Open

PhantomJS: Can't click a button #140

Sebazzz opened this issue Feb 26, 2015 · 0 comments

Comments

@Sebazzz
Copy link
Contributor

Sebazzz commented Feb 26, 2015

Using the following quite simple web forms page:

    <asp:TextBox ID="tbEmail" runat="server" ClientIDMode="Static" />
    <asp:TextBox ID="tbPassword"  runat="server" ClientIDMode="Static" />
    <asp:Button ID="LoginButton" runat="server" ClientIDMode="Static" />

Using PhantomJS and the following test code:

    public LoginPage LoginWithCredentials(string userName, string password) {
            this.I.Assert.Exists("#tbEmail");
            this.I.Assert.Exists("#tbPassword");
            this.I.Assert.Exists("#LoginButton");

            this.I.Enter(userName).In("#tbEmail");
            this.I.Enter(password).In("#tbPassword");

            this.I.Click("#LoginButton");

            return this;
        }

Clicking on the button fails. It simply doesnt trigger anything.

Replacing this.I.Click(...) with the following code does work as expected:

            ElementProxy reference = this.I.Find("#LoginButton");
            Element element = (Element)reference.Element;
            IWebElement seleniumElement = element.WebElement;
            seleniumElement.Click();

It only appears to fail when using PhantomJS. Chrome works fine. I wasn't able to test with Firefox due to the test process crashing, and IE fails with a NullReferenceException.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant