
Show HN: Helium – Lighter web automation based on Selenium - mherrmann
https://github.com/mherrmann/helium
======
wpietri
I really appreciate the frankness in the paragraph that starts with this: "I
have too little spare time to maintain this project for free. If you'd like my
help, please go to my web site to ask about my consulting rates."

I hope drawing a clear boundary like that reduces some of the entitled
nonsense that can happen around open-source projects.

~~~
rumanator
> I hope drawing a clear boundary like that reduces some of the entitled
> nonsense that can happen around open-source projects.

Case in point: Rust's actix web

[https://www.theregister.co.uk/2020/01/21/rust_actix_web_fram...](https://www.theregister.co.uk/2020/01/21/rust_actix_web_framework_maintainer_quits/)

[https://www.reddit.com/r/rust/comments/epoloy/comment/feksq2...](https://www.reddit.com/r/rust/comments/epoloy/comment/feksq2i)

Regardless of where you are on the soundness telenovela, the fact that a lot
of the FLOSS project consumers felt entitled to demand access to a well
maintained project for free and complained that even forking a project is not
a valid option because they expect someone else to spend their personal time
to benefit them personally is an attitude that boggles the mind.

------
ivan_ah
@mherrmann What would be the comparison / difference with SeleniumBase
[https://github.com/seleniumbase/SeleniumBase](https://github.com/seleniumbase/SeleniumBase)
?

I'm always on the lookout for browser automation using Python so excited to
try this framework. I was a big fan of
[https://github.com/miyakogi/pyppeteer](https://github.com/miyakogi/pyppeteer)
but it doesn't seem to be maintained anymore.

There is another project by microsoft called playwright, though it's js-only
for now. They don't have plan for Python bindings for now
[https://github.com/microsoft/playwright/issues/1043](https://github.com/microsoft/playwright/issues/1043)

------
ng12
Has anyone had rousing success with automation tests like this? I almost
always find the ratio of maintenance to issues caught to be unacceptably high,
especially when compared to simple unit tests.

~~~
l0b0
As much as I love unit tests (being simpler and running more than 1000 times
faster than web tests) there is a place for basically all types of tests in a
CRUD application. 100% unit test coverage isn't going to help you if you can't
actually spin up the whole system and serve requests over high-level
protocols.

It's all about ROI, and ROI is huge for simple high-level smoke tests.

~~~
freeone3000
My experience with selenium is that the tests broke more often than the UI,
whether through timing issues, DOM changes, or framework changes. The binding
is on a layer that humans don't see, and it makes it fragile.

~~~
gregmac
I was recently involved in my first "integration testing" project involving
Selenium, Winium, and ssh (doing cross-platform testing of an installer).

One of the things that really struck me as I was reading through examples and
such was how common it seems to be to have test code like "Click x; Wait 5
seconds; Click y; Type 'abc'; Click Z". My experience with unit testing tells
me that as tests break 'randomly' (because something occasionally takes a few
milliseconds too long to load) those delays get inserted, and eventually you
end up with slow tests that are harder to maintain and _still_ flaky.

In my project, we were installing on a variety of OSes and versions, and based
on what dependencies had to be downloaded+installed it could take anywhere
from a few seconds to a couple minutes. I ended up writing a lot of helper
functions like `WaitForFile(filename, absoluteTimeout)` that basically run a
retry loop, checking every couple seconds (to allow fast-as-possible
pass/fail), but frankly was surprised that this was non-standard -- I kind of
expected any "integration test assertion library" to be chock full of helpers
like this.

I think there's a lot of ground to be covered in improving integration testing
in general, and especially bringing in some more modern software design and
engineering principles. Unit and integration tests are still _code_ after all
-- just because it doesn't ship with the product doesn't mean it shouldn't be
maintained at the same quality.

~~~
opless
Wait for five seconds?

That's the first mistake.

You should always wait for some kind of state change, you're just building in
fragility.

~~~
ethbro
This. If your framework only does timing through pausing, find a new
framework.

That's 20 years out of date.

------
eindiran
Very cool project OP: it looks like it gets rid of the major pain points I've
had with Selenium. In particular, smarter handling of iframes and the better
explicit waits are huge wins over vanilla Selenium. I'm glad you decided to
release this, especially since you chose to use a permissive license.

------
snowl
I don't see people talk about TestCafe which is open source and is an actual
alternative without being dependent on WebDriver at all

~~~
RexM
I haven’t personally used it, yet, but my team has been really happy with
TestCafe. The tests seem much less flakey than selenium.

------
asimjalis
What’s the relationship between Helium and HeliumHQ? They look like similar
products.

[https://heliumhq.com/](https://heliumhq.com/)

~~~
mherrmann
HeliumHQ used to be the commercial offering of Helium. We shut down that
company at the end of 2019. The GitHub link you see here now is the same code,
modernized and open sourced. See the history section at the bottom of the
GitHub README.

~~~
asimjalis
Why didn’t the commercial offering succeed?

~~~
mherrmann
Developers don't like to pay for software libraries so it was an uphill
battle. My co-founder (our "COO") moved on because he got a very lucrative
offer. I wanted to buy out his 50% of the business, he asked for a 40x
multiple of yearly revenue. (For context, online businesses usually go for
2-3x.) In this stalemate, I did not want to continue growing the business with
him owning 50% of it. Now that revenue has, through years of inactivity, died
down to essentially 0, he agreed to let me open source it.

------
vadiml
I've been using SiculiX for GUI testing.... It has GUI and OCR, i wonder if
helium could be in SiculiX scripts

------
keva161
I created a blog post on this:

[https://kevintuck.co.uk/browser-automation-with-
hellium/](https://kevintuck.co.uk/browser-automation-with-hellium/)

Great little tool!

~~~
mherrmann
Awesome, thanks!

------
lqs469
That reminds me of this:
[https://news.ycombinator.com/item?id=22374991](https://news.ycombinator.com/item?id=22374991)

Those tools perhaps will be useful for automated testing or accessibility,
etc.

------
jfax
This appears to be very similar to Capybara in Ruby, which I've used
extensively. I was under the impression that implementations of Selenium were
as high-level as this every language.

~~~
PopeDotNinja
The nice thing about Capybara and other "in stack" tools is you have tight
integration with the database, so setting up test data and resetting it is
easy. And for the tests that don't require JavaScript, the tests can still be
made to run quite fast.

------
dvfjsdhgfv
Has anyone managed to log in to Facebook or Instagram using it?

~~~
lorey
AFAIK Selenium is easily recognizable as it inserts itself in the DOM, so I
would guess that they will block you pretty quickly.

If you're interested: [https://stackoverflow.com/questions/33225947/can-a-
website-d...](https://stackoverflow.com/questions/33225947/can-a-website-
detect-when-you-are-using-selenium-with-chromedriver)

~~~
dvfjsdhgfv
OK so I did a few tests with FB, using an existing account data and managed to
change status without getting banned. Will continue testing as it would be a
very convenient way to post status updates without having to actually use FB.

------
WalterBright
Pretty soon people are going to run out of elements to name their products
after. Naming things after letters in the alphabet is a better strategy.

------
jschwartzi
Oh, hey, I basically started writing something exactly like this when I
started using Selenium to script some test cases.

~~~
pintxo
Same here.

As a lot of the Selenium API is quite low-level (speaking about the Java
variety).

Would be wonderful if this and similar efforts would end up in the core
Selenium project, keeping the low-level options, but providing an easier to
use layer on top.

~~~
thangalin
+2, about six years ago now.

[https://bitbucket.org/djarvis/scripted-
selenium/wiki/Home](https://bitbucket.org/djarvis/scripted-selenium/wiki/Home)

The video shows a script running itself.

[https://www.youtube.com/watch?v=tGvcm0Rlm-0&hd=1](https://www.youtube.com/watch?v=tGvcm0Rlm-0&hd=1)

------
captainmarble
Why can't it directly use chrome devtools protocol?

~~~
eindiran
The reason why it doesn't use the Chrome DevTools Protocol is that it (Helium)
is a wrapper around Selenium WebDriver [0].

One advantage of wrapping WebDriver, rather than using something like the
Chrome DevTools Protocol, is that WebDriver has an interface specified by an
W3C Standard [1] [2], and can be implemented for any browser. The Chrome
DevTools Protocol (obviously) only works with browsers based on Chrome.

[0]
[https://www.selenium.dev/documentation/en/webdriver/](https://www.selenium.dev/documentation/en/webdriver/)

[1] [https://www.w3.org/TR/2018/REC-
webdriver1-20180605/](https://www.w3.org/TR/2018/REC-webdriver1-20180605/)

[2] [https://github.com/w3c/webdriver](https://github.com/w3c/webdriver)

------
zabil
This is great news, especially for Selenium users. Helium is a great tool.

~~~
mherrmann
Your "thanks" is really just a cheap way to advertise your own solution ;-)

(Edit: zabil removed the link to his project.)

~~~
fraktl
Awww, straight to the point and bullseye :)

I'm glad someone wrote what I had thought :D

