As I write this, the capital city of England currently hosts a large sporting event. I can mention no names nor dates, for that sequence of words forms part of the protected thou shalt not use list. I don’t even know if ‘they’ will allow me to link to that page.
Regardless, I created a small test app which pays tribute to sporting events through the years.
Since I grew up in the 80s, programming on ZX Spectrums, I have a fondness for scrolly text that judders. I decided to replicate this effect using the browser title and hacking in my own text, overwriting the official text in page
I don’t do this a lot when writing automated tests, but I have to confess - I don’t let the application functionality stopping me testing it. So I do sometimes force elements to be visible so that I can access them through automation. I mainly do this for exploratory automation work.
If you have never done this before then I shall recommend now that you try it. Rule nothing out in your hunt for test automation effectiveness.
I primarily wrote this little script to experiment with the WebDriver window positioning commands:
- (WebDriver) .manage().window.setSize
- (WebDriver) .manage().window().getPosition()
- WebDriver) .manage().window().setPosition()
The listing from the video is below:
Since I only planned to let the demo run for a short period of time you can see that I just let the banner string extend and extend and extend by continually appending the text to it. Seemed like a nice sensible shortcoming given the nature of the demo. Just a warning to you in case you decide to put this into a loop for an hour or so.
You can find the full source listing at https://github.com/eviltester/webDriverExperiments/
The ascii animation was created using asciimator.net
A fun extension, should you want a challenge, would be to create 3 windows, size them, and then have WebDriver play a game of PONG with them.