Proxy & Executor

In the last two weeks I have given a talk at 3 different Se user groups, in two different countries. The same talk in fact. (Even the same jokes!)

The talk has two parts.

Part One – Proxy

The idea here is that you should be running all your Se through a proxy as just a normal course of habit. Partly so you can get http codes but also so you can retrieve HAR files. As a tester, the information locked in the HAR file around timing and cache and headers and … is far more interesting than just the status code. Tip: Only put a single page in a HAR file to keep them small for parsing.

The big reason you want to run things through a proxy is to get rid of 3rd party crap. I’d recommend using a random HTTP code for your blacklist entries so you can see how effective your blacklist is.

Part Two – JS Executor

This is the magical hammer of WebDriver. It, well, executes random JS. With some pretty cool features; primarily the ability to pass in arguments. AND if that argument is a WebDriver Element, it does the magical DOM pixie tricks to send it at the right place.

What can you use it for? The FUTURE! And the Past.

First, the Past. And the Past in this story is Flash and Flex. If you install FlexPilot into your .swf file it will expose a whack of methods that are pollable through JS. These methods are then accessed via the JS Executor something like in FlexPilot.php.

HTML5 and Canvas play the role of the Future. Unfortunately, there is nothing to magically expose things to be automated with. That is entirely up to the developer. But once they are there, the JS Executor is what will be used to get at them.

And since we’re going the Scrooge idea, Today is the realm of JS Widgets. Sure, they look like HTML but they are really JS objects with a sneaky skin. You need the JS Executor to ‘interact’ with those too such as with the dhx combo box.

Dear JS Widget vendors; if you are not going to all close up shop overnight, please provide the hooks to automate your stuff!

And that’s pretty much the talk’s, erm, talking points. If you wonder what the jokes and snark were like, you are in luck! Here is the video from SFSe

And the video from SJSe.

Comments 1

  1. Chris wrote:

    Thanks for this very useful information, Adam! It sounds like most developers are testing what the user sees. I’m actually one of the rare developers who are actually trying to verify and test the tracking code itself. I toyed around with Selenium for automating some screenshot capturing previously, so I’ll keep getting my hands dirty and start playing around with the proxy idea.

    Posted 04 Mar 2017 at 11:08 pm

Trackbacks & Pingbacks 1

  1. From A Smattering of Selenium #106 « Official Selenium Blog on 31 Jul 2012 at 6:45 am

    […] Proxy & Executor is the meetup talk I did at SFSe, SJSe and YYZSe over the span of 10 days this month. Slides, multiple video, notes, etc. […]

Post a Comment

Your email is never published nor shared. Required fields are marked *