Day 160: Browserflow Direction
Woah, I almost went to bed without writing a post today, but I remembered just as I was brushing my teeth!
I’m freaking tired (it’s 3AM) so I’m going to write some notes about Browserflow and head to bed.
I built Browserflow with the idea of automating tasks, but there are a few other use cases for this technology:
- UI testing (e.g. after clicking button X, verify your application shows Y)
- Web scraping (e.g. given a list of names and emails, create a list of their LinkedIn URLs)
Even within task automation, there are variants that I haven’t touched yet:
- Different trigger conditions (running a task at a certain time, every time you visit a particular site, etc.)
- Control flow (looping actions, conditional actions (if/else), etc.)
Some of the questions that come to mind when I think about how I want to continue with Browserflow:
- What will be the predominant use case? (task automation vs. UI testing vs. web scraping)
- Who is my target user? (developer vs. non-technical)
- How do I want to design the API?
The last question comes up a lot when adding features and new actions. For example, I have a GET_TEXT action that gets the text of a user-selected element. But that can also be created using the SCRIPT action with the code return document.querySelector('$selector').innerText
It’s redundant to have the GET_TEXT action, but it does make that action more convenient. When do I choose to provide convenience methods and when do I not?
There’s a strong pull towards keeping the API as minimal as possible so that people can quickly see all the things they’re able to do with Browserflow. But non-coders will have a harder time because while Javascript developers could figure out that they can use a SCRIPT action with the code document.execCommand('paste') in order to paste from their clipboard, that won’t be obvious to most people and they’ll find it easier to use a PASTE action.
I feel like I’m designing a programming language. What should be in Browserflow’s standard library and what should be left to the users to implement?