0

How can I install and run CasperJS files in Android? Is it possible?

I would like to create an equal application droidscript with test functions and execute on a webview.

peter
  • 41,770
  • 5
  • 64
  • 108
fredericoallan
  • 101
  • 2
  • 9
  • I'm having similar use case now. I have a JS application that also is encased in an android webview as an android app. I have casper tests written for my JS application. I want to be able to run these casper tests in an android webview env. @fredericoallan, Did you figure out any workaround? – kbsbng Aug 20 '19 at 18:46

1 Answers1

1

CasperJS is built on top of PhantomJS (and SlimerJS). Those are browsers themselves. They cannot be run in a WebView. It may be possible to compile, though I didn't find any documented trials.

You should be able to port the PhantomJS API to an Android WebView and then make some adjustments to CasperJS so that it uses this new API and can be run through DroidScript. This is a big task.

An easier task would be to keep a PhantomJS/CasperJS instance running on a server (or spawn an instance from the server-side framework you would like to use) and query it with the specific scripts from your app. You can send all screenshots that are made to the app, but a live video view will not be possible.

Artjom B.
  • 61,146
  • 24
  • 125
  • 222