Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Click done but the related action never happens on phantomjs. Works with chrome. #14385

Closed
bhuvnesh2703 opened this issue Jun 28, 2016 · 3 comments
Labels

Comments

@bhuvnesh2703
Copy link

Problem:

A Button is selected correctly with the CSS selector used, and then a click is performed on it. The event is marked as done as seen in the selenium logs, however if successful a new page must be rendered which does not happen.
The same piece of code works in chrome.

Environment:

WDIO version: v4.0.9
Node: 6.2.0
WDIO testrunner
Synchronous test.
selenium-server-standalone-2.53.0.jar
bhuvneshchaudhary@bhuviMac:ambari-selenium$ ./node_modules/phantomjs/bin/phantomjs --version
2.1.1

Details

      CommonElements.clickNext();
      browser.saveScreenshot('test1.jpg');
      browser.pause(5000);
      CommonElements.clickConfirmationOk();
      browser.pause(5000);
      // On Page 3
      browser.saveScreenshot('test.jpg');
      CommonElements.clickComplete();

In the above code snippet
clickNext() opens up a popup which has 2 buttons Cancel and Ok.
clickConfirmationOk() should click on the Ok button and move on to the next page
clickComplete() marks the completion on the new page.

However, clickConfirmationOk() is succesful as per the logs and it moves on to clickComplete(). However it keeps waiting for the element to exist, but it never comes up as actually its still on the pop which shows Ok and Cancel.

The CSS selector used to identify the button is correct, as verified by getHTML and other css selectors tools online.

Code Snippet

    clickConfirmationOk: {
        value: function () {
            var okSelector = '.modal-footer .btn.btn-success';
            browser.waitForExist(okSelector);
            console.log(browser.getHTML(okSelector));
            browser.waitForEnabled(okSelector, 100000);
            browser.click(okSelector);
        }
    },
    clickComplete: {
        value: function () {
            var completeSelector = '#common-progress-page .btn.btn-success.pull-right';
            browser.waitForExist(completeSelector);
            console.log(browser.isEnabled(completeSelector));
            browser.waitForEnabled(completeSelector, 900000);
            browser.click(completeSelector);
        }
    }

Logs

Selenium Logs https://gist.github.com/bhuvnesh2703/aec82bea06debf92f9a4f6e4da93c2ea:
Test Results Output: https://gist.github.com/bhuvnesh2703/076af36f5931c8fdae4a81db612bf4b7

@atodorov
Copy link

atodorov commented Jul 4, 2016

@bhuvnesh2703 does this happen every time for you or only sometimes ? I'm seeing a similar problem where we use Capybara's find('#element').click and sometimes the tests fail. Using find().trigger('click') seems to work however.

I'm wondering whether this is the same problem or not and how to collect more information.

@billyvg
Copy link

billyvg commented Jul 18, 2016

I'm also having a similar problem, but with bootstrap dropdown menus. I'm able to open the dropdown menu but if I try to click an element within the dropdown menu, the menu closes but no click handler is fired.

@stale stale bot added the stale label Dec 26, 2019
@stale
Copy link

stale bot commented Dec 29, 2019

Due to our very limited maintenance capacity, we need to prioritize our development focus on other tasks. Therefore, this issue will be automatically closed (see #15395 for more details). In the future, if we see the need to attend to this issue again, then it will be reopened. Thank you for your contribution!

@stale stale bot closed this as completed Dec 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants