Casperjs command line : how to reset completly phantomjs ?

138 views
Skip to first unread message

Shanayalameda

unread,
Apr 6, 2017, 8:35:52 AM4/6/17
to CasperJS
Hi Casperjs's fan,

I'm currently working on automated tests execute with casperjs on jenkins.

I've created a nodejs project which contains my tests. My "start" step contains following command :  casperjs test pages/* (pages contains all tests)
Each tests contains a logon function and a logoff function to be sure to reinitialize browser
When I run this command, each tests were execute  but casperjs do not reset phantomjs (even if I specified casper.clear() and phantom.clearCookies() )
Do you know if parameter exists to reset completly phantomjs ?

Thanks in advance,

Alameda

Ken

unread,
May 28, 2017, 9:56:17 PM5/28/17
to CasperJS
I saw some issue on GitHub page on this.. Hmm is it possible for your use case to call CasperJS from Linux shell script or Windows batch file? This way you can do the iteration by really closing and starting PhantomJS again. I don't know if this is the best way but I do it this way to ensure each new run is started fresh and maybe any garbage in memory is cleaned up, especially for large runs. I've done it for runs over 1000+ iterations without issue. Here is the sample script - https://github.com/tebelorg/TagUI/tree/master/src

Shanayalameda

unread,
May 29, 2017, 3:57:40 AM5/29/17
to CasperJS
Hi Ken,

Thanks you for your answer. My test are finally run with shell script to avoid this issue. It's annoying to use this cheat to perform correctly test.

Ken Soh | Tebel

unread,
May 29, 2017, 4:14:20 PM5/29/17
to casp...@googlegroups.com
​Hi Alameda,

I see.. Thanks for sharing your final implementation method. Yes.. PhantomJS has much memory issues​ and I guess using shell or batch file as wrapper might be the stable way to run high-volume tests. Adding on the thread for PhantomJS memory issues - https://github.com/casperjs/casperjs/issues/1581


Kind Regards,

--
CasperJS homepage & documentation: http://casperjs.org/
CasperJS @github: https://github.com/n1k0/casperjs
 
You received this message because you are subscribed to the Google Groups "casperjs" group.
Visit this group at http://groups.google.com/group/casperjs?hl=en.
---
You received this message because you are subscribed to a topic in the Google Groups "CasperJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/casperjs/rRUOC6tN6Wc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to casperjs+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages