Is there a way to get a realtime view of what PhantomJS (or similar) is rendering?
I would like to develop my automation script while interacting with (or at least seeing a screencap of) the page it's targeted to.
PhantomJS is a discontinued headless browser used for automating web page interaction. PhantomJS provides a JavaScript API enabling automated navigation, screenshots, user behavior and assertions making it a common tool used to run browser-based unit tests in a headless system like a continuous integration environment.
Selenium, Electron, Protractor, wkhtmltopdf, and SlimerJS are the most popular alternatives and competitors to PhantomJS.
PhantomJS is deprecated because the (sole) author decided to stop development on it. However, it's not broken, it works perfectly fine for Bokeh's needs, there is no particular reason no to use it, as long as you have a selenium version installed that supports still supports it.
PhantomJS And Selenium For Web Automation (Basic) Just like any other browsers with GUI interface (Firefox, IE, Chrome, etc.), for PhantomJS also, Selenium has a standard API to support the automation.
No, there is no such thing. SlimerJS has the same API as PhantomJS, but runs the Gecko engine. You can see directly what is going on and run it headlessly with xvfb-run.
You will not be able to interact with it. You may want to use a screengrabber to record a video of the interaction when the tests are long and you don't want to run the test suite again if you didn't catch the problem in the test case.
The obvious way to debug PhantomJS scripts is to render many screenshots using page.render()
and logging some objects to the console with
console.log(JSON.stringify(yourObj, undefined, 4));
with nice formatting.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With