Looking for PhantomJS Consultant

117 views
Skip to first unread message

Joshua Odmark

unread,
Jun 30, 2014, 5:14:51 PM6/30/14
to phan...@googlegroups.com
We use PhantomJS and CasperJS extensively and are interested in having some improvements and fixes created.

Here are a few:
  • Native event support such as clicking
  • Diagnose why some websites load intermittently and some not at all
  • Help diagnose crashes
  • Make more libraries from the headless browser available
  • And More
This is for a well funded company wishing to work on a contractual basis.

Thanks!

-Josh

phantom...@gmail.com

unread,
Jul 7, 2014, 11:49:24 PM7/7/14
to phan...@googlegroups.com
  • Native event support such as clicking
... Hm.  What's not supported with this?

I'll have to look at my code, but I *think* I just created click events directly and sent them to elements.  

I can pull it out if you guys can make it into a library.

It actually might be nice for phantomjs to have a helper library for things like this.

There is some fun stuff you can do with Javascript to get phantom to do some fun things but only if you dive into JS internals.

Darren Cook

unread,
Jul 8, 2014, 3:30:45 AM7/8/14
to phan...@googlegroups.com
> - Native event support such as clicking
>
> ... Hm. What's not supported with this?
>
> I'll have to look at my code, but I *think* I just created click events
> directly and sent them to elements.

I blogged on how to do that recently:
http://darrendev.blogspot.co.uk/2014/06/casper-d3-jquery-and-clicking.html

That was in the context of Casper, but all the sections except the first
use evaluate(), so apply equally well to PhantomJS.

Darren



--
Darren Cook, Software Researcher/Developer
My new book: Data Push Apps with HTML5 SSE
Published by O'Reilly: (ask me for a discount code!)
http://shop.oreilly.com/product/0636920030928.do
Also on Amazon and at all good booksellers!

Joshua Odmark

unread,
Jul 8, 2014, 12:47:42 PM7/8/14
to phan...@googlegroups.com
The biggest problem is the difference between synthetic events, native browser events, and native operating system events.

With Selenium, you can trigger all three (given the right setup with Selenium, the operating system, and the browser).

Here is a little information on native events: https://code.google.com/p/selenium/wiki/NativeEventsOnLinux

I can't find it now, but I saw a comment by Ariya Hidayat that mentioned the events created by PhantomJS are synthetic, and that he saw no reason to support native events.

/////////////////////////////////////////////////////////////////
Joshua Odmark




--
You received this message because you are subscribed to a topic in the Google Groups "phantomjs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phantomjs/wnA86Wg6Ruk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to phantomjs+...@googlegroups.com.
Visit this group at http://groups.google.com/group/phantomjs.
For more options, visit https://groups.google.com/d/optout.

James Greene

unread,
Jul 8, 2014, 12:51:39 PM7/8/14
to phan...@googlegroups.com
Use `page.sendEvent` for native browser events.  From http://phantomjs.org/api/webpage/method/send-event.html :

The events are not synthetic DOM events, each event is sent to the web page as if it comes as part of user interaction.

Sincerely,
    James Greene



--
You received this message because you are subscribed to the Google Groups "phantomjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phantomjs+...@googlegroups.com.

phantom...@gmail.com

unread,
Jul 9, 2014, 3:29:58 PM7/9/14
to phan...@googlegroups.com
I think the problem with sendEvent and also sending keyboard clicks is knowing whether event listeners are registered and whether the event was received.

Because javascript can be async, you could send an event or click the keyboard BEFORE the page has added the event listener.

I wrote an implementation of getEventListeners (which doesn't exist in DOM) so that I could wait until the event listener was added, then send the keyboard event.
Reply all
Reply to author
Forward
0 new messages