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

Need to run "before" function before "waitForSelector" #4

Closed
SLyHuy opened this issue Aug 21, 2015 · 2 comments
Closed

Need to run "before" function before "waitForSelector" #4

SLyHuy opened this issue Aug 21, 2015 · 2 comments

Comments

@SLyHuy
Copy link

SLyHuy commented Aug 21, 2015

Hi,

I want to click on button, and the page load ajax to show a popup.
So the selector will "was not found anywhere on the page".

I need to run "before" function first, to simulate click on the button first and after then call "waitForSelector".

casperInstance.waitForSelector(captureState.selector, function() {

        // Processing before capture callbacks:
        if (captureState.before) {
          // Siblings are before functions made available in other before functions,
          // see http://succss.ifzenelse.net/configuration#before.
          var siblings = {};
          var pageCaptures = data[captureState.page.name].captures;
          for (var c in pageCaptures) {
            if (c != captureState.name && pageCaptures[c].before) {
              siblings[c] = pageCaptures[c].before.bind(casperInstance, siblings);
            }
          }
          captureState.before.call(casperInstance, siblings);
        }
      }, function() {
        self.echo('Selector "' + captureState.selector + '" was not found anywhere on the page.', 'ERROR');
      });

Can you help me to build this script? Please I don't know how to do that.

Thank you,
Huy Ly.

@B2F
Copy link
Owner

B2F commented Oct 13, 2015

Did you succeed yet with this use case ? If not, please read the related documentation (it's in the "Before capture" paragraph of the configuration section): http://succss.ifzenelse.net/index.html?page=configuration#before

@SLyHuy
Copy link
Author

SLyHuy commented Oct 14, 2015

Yes, I did. Add one more params and call it in succss. Let's close it.
Thanks.

On Wednesday, 14 October 2015, Didier notifications@github.com wrote:

Did you succeed yet with this use case ? If not, please read the related
documentation (it's in the "Before capture" paragraph of the configuration
section): http://succss.ifzenelse.net/index.html?page=configuration#before


Reply to this email directly or view it on GitHub
#4 (comment).

Lý Trung Huy
Facebook: http://www.facebook.com/lytrunghuy
Skype: s.lyhuy
Mobile: +84976400806 or +6591404953

@B2F B2F closed this as completed Oct 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants