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.