The Beginners’ Guide to Automating Websites and Tests With Selenium
So What Do We Do With This Newfound Knowledge?

With the basics laid out, let me show you some examples of how to apply Selenium in the real world to save yourself time and effort.

Automate your posting queue

Let’s say you have a Tumblr blog about, I don’t know, books spread open in nature, maybe. I think that’s what people use Tumblr for ever since the big ban in 2018. Let’s also assume you have a curation blog that reblogs the best content from a hundred other blogs — a couple posts each day.

You spent a long time collecting 1,000 good posts, but Tumblr being Tumblr, you can only queue 200 of them at the same time. So instead you used something like Session Buddy to collect all the URLs in an efficient manner and saved them to a spreadsheet.

I may or may not have a couple decaying spreadsheets that were decidedly not about books, so now they’d be completely useless, but I digress. Tumblr got sold for $3 million — that’s eased my pain.

So with this long list of great, earth-shaking posts, you could now write a little Selenium script that logs into Tumblr, goes through 200 posts at a time, and adds them to the queue. You could even write randomized captions and experiment with Spintax to make it all look natural — not that anybody would do something like that, not with books.

You could then even put this script on a scheduled task so it runs once per month and then loops once it’s done because no one will even notice that you’re recycling posts when your list is 1,000 long and lasts three months before looping over.

Test, test, test

Besides task automation, you’ll most likely be using Selenium for automated testing of anything that faces the interwebs. Here are some things you could easily set up to automate testing:

Do an automated login into your customer dashboard every couple minutes to check that everything is working, send an email, or raise an alert if that fails.

Download a file to ensure that the database is online and all connections run smoothly

Check that these tasks don’t take considerably longer than they usually do; raise an alert if connection speeds are slow

Automated reporting

The last important thing Selenium can do for you is automated report generation.

I already touched on this in the testing portion with the alerts for slow or nonworking connections, but let’s assume you were running a bunch of different ads on your Tumblr blogs about books and also had some affiliate links, and now you might want to get a daily reporting of which of these avenues performed best.

You could manually log into all of those different websites, copy the daily sums, and transfer them into a spreadsheet — but why not automate that task?

Or you can get yourself a daily digest of news headlines or stock prices. Other people pay money for those things. In fact, why not set up a paid service that supplies those values to hundreds of people who, in turn, happily give you their money for saving them hours of time and giving them an edge over the competition?
[]
['Testing', 'Tdd', 'Front End Development', 'Programming', 'Technology']