简体   繁体   中英

Where is Casper.js' sendEvent defined?

I'm trying to figure out how exactly is Casper.js using underlying Phantom.js to move the mouse .

I found that casper.page.sendEvent() is responsible but where is sendEvent defined and how does it interact with PhantomJS?

Since CasperJS is built on top of PhantomJS, you can use any PhantomJS function inside a CasperJS script through the casper.page object.

One such function is page.sendEvent which enables you to trigger native user events in PhantomJS.

The documentation says the following for mouse move:

For 'mousemove', however, there is no button pressed (ie it is not dragging).

If you still want to see how it is implemented, you can find it here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM