News for hackers. Stuff that matters.
Re:Show HN: I created a browser automation tool by fareesh on Friday August 05, 2022 @03:23PM (#32360750)
There's a chrome extension that records all your steps and then generates a puppeteer/playwright script for you. Then you can just edit bits of that script and run it. This is my go-to method presently.

I feel like you could incorporate some of those features into this and eliminate some of the manual entry of css selectors.

Re:Show HN: I created a browser automation tool by hoten on Friday August 05, 2022 @08:54PM (#32363729)
FYI this is now built into the Chrome devtools "Recorder" panel.
Re:Show HN: I created a browser automation tool by lrobinovitch on Friday August 05, 2022 @06:38PM (#32362784)
Browserflow https://browserflow.app is excellent!
Re:Show HN: I created a browser automation tool by mouzogu on Saturday August 06, 2022 @03:31AM (#32365850)
I really like the clean and simple layout of this website. It looks like bootstrap maybe. I wish more websites would follow this kind of layout.
Re:Show HN: I created a browser automation tool by xnx on Friday August 05, 2022 @03:56PM (#32361205)
Re:Show HN: I created a browser automation tool by eastendguy on Saturday August 06, 2022 @06:58AM (#32366937)
I use both!

UI Vision is unique because it supports visual automation with image recognition and OCR. A bit like Sikuli but inside the browser. This avoids dealing with CSS selectors and XPaths.

Re:Show HN: I created a browser automation tool by magundu on Saturday August 06, 2022 @12:15AM (#32364779)
We are using Automa chrome extension for this kind of use cases. We really like it. It is free and open source. If you are thinking of building a product, you can make use of it.

https://www.automa.site/ https://github.com/AutomaApp/automa

Re:Show HN: I created a browser automation tool by iamandras on Friday August 05, 2022 @03:25PM (#32360772)
Oh, interesting. What is the name of that extension?
Re:Show HN: I created a browser automation tool by EddySchauHai on Friday August 05, 2022 @05:30PM (#32362201)
You can do it in the chrome browser tools! There's a record section. Note if you're doing this for automation testing it's going to be pretty flakey and you're better off following best practices and using custom testing selectors instead :)
Re:Show HN: I created a browser automation tool by fizzpack on Friday August 05, 2022 @06:03PM (#32362491)
Why is it flakey for automation testing though? In my experience that's basically targeting page elements and interacting with them. Doesn't this do the same thing?
Re:Show HN: I created a browser automation tool by EddySchauHai on Friday August 05, 2022 @06:58PM (#32362899)
It uses a combination of xpaths that are like body[1]div[2]div[1]p[2]button[1] so if you edit the UI it'll break, or worst case they do X,Y coordinates of clicks on a page so if the UI changes it'll break. Sometimes it'll get your ID or Name or whatever but some frameworks randomize these on compilation and some devs change them as part of refactoring.

Best practice is to add test attributes to the HTML elements (such as data-testid="SubmitButton") so if the page is moved around or the button is edited the tests remain stable. There's a lot of good online sources on making UI testing somewhat more reliable :)

Re:Show HN: I created a browser automation tool by yowmamasita on Saturday August 06, 2022 @10:08AM (#32368221)
It detects the data-testid attribute quite well. We use it at work in replacement of manually creating cypress scripts.
Re:Show HN: I created a browser automation tool by EddySchauHai on Saturday August 06, 2022 @12:22PM (#32369402)
That’s good to know, I had bad luck with it then. But even so, you also lost the ability to use testing patterns like the page object model where you can update changing IDs or flows more easily - if something changes drastically early in the recording, wouldn’t it need to be re-recorded for all test cases?
Re:Show HN: I created a browser automation tool by Fnoord on Friday August 05, 2022 @03:36PM (#32360921)
Selenium allows this, and its also there for Firefox. You can even export the actions as a different language e.g. Python.
Re:Show HN: I created a browser automation tool by fareesh on Friday August 05, 2022 @06:34PM (#32362747)
Re:Show HN: I created a browser automation tool by yareally on Friday August 05, 2022 @05:13PM (#32362047)
Re:Show HN: I created a browser automation tool by czbond on Friday August 05, 2022 @03:42PM (#32360986)
I just started using a Selenium IDE + selenium-side-runner for headless automation. Is puppeteer or Selenium a more widely supported tool?
Re:Show HN: I created a browser automation tool by bckr on Friday August 05, 2022 @06:50PM (#32362857)
Selenium is more widespread but I recommend Playwright as the most modern automation library. Comes with plugins for making your automations more... nimble.
Re:Show HN: I created a browser automation tool by czbond on Thursday August 11, 2022 @02:49PM (#32430088)
Thank you - I'll try it out.
Re:Show HN: I created a browser automation tool by EddySchauHai on Friday August 05, 2022 @05:45PM (#32362323)
Selenium is the most popular tool in the industry but mostly for legacy reasons, its real competitor is Cypress. If you've just started a project I'd recommend checking it out, a huge time saver is that you install it as an npm package with a headless browser out the box without any webdriver/infra stuff slowing you down.
Re:Show HN: I created a browser automation tool by czbond on Thursday August 11, 2022 @02:49PM (#32430092)
Thank you - I'll check it out.