Adding a WebDriver function for evaluating PhantomJS directly

26 views
Skip to first unread message

Mark Watson

unread,
Mar 11, 2013, 1:21:44 AM3/11/13
to phan...@googlegroups.com
PhantomJS provides some things that are not available through most WebDriver implementations and are thus not in the base WebDriver wire protocol.  For me I had a use for:

1. Patching the browser JavaScript environment before loading the URL (for example override navigator.platform).
2. Generating different sized screenshots which is only possible using page.setClipRect()/page.setViewport().

But I also needed to keep the bulk of my scripts in WebDriver.  So an additional WebDriver command for executing PhantomJS code directly would be really useful.

I've added an issue (should be marked as feature, but I wasn't sure how to do that), along with an attached patch here:

  https://code.google.com/p/phantomjs/issues/detail?id=1126

Cheers!
Mark

Reply all
Reply to author
Forward
0 new messages