Live data from Hacker News

Prototype: Puppeteer for Firefox

github.com

51–60 of 133 posts

Re: Prototype: Puppeteer for Firefox

#51

Firefox has lost its lead because it's lost the developers. Chrome has invested massively in developer tools for chrome and it's shows.... I think chrome is the best software ever written. The developer tools are so powerful that it'd hard to even know the full breadth of what's in there. Firefox offers nothing to developers over chrome, which is sad.

https://github.com/tridactyl/tridactyl

Vimium/cVim just doesn't match up and aren't under as aggressive development. For this keyboard-focused developer, there's not a good enough reason to be on Chrome. I know I am in the minority, but it's a point nonetheless.

Re: Prototype: Puppeteer for Firefox

#52
post #16

Earlier quoted context omitted.

Interesting, I thought Firefox usage would be increasing based on all the hype/people converting on HN/other tech websites but the market share is actually falling. Guess it puts into perspective the size of that cohort compared to the rest of the world.

After Firefox broke most extensions with their removal of XUL extensions and embrace of "WebExtensions" (aka Chrome extensions), it lost a major differentiation point from Chrome. People simply have no (immediate, practical) reason to use Firefox. Back in the Mozilla days i was using Mozilla because it was very powerful and flexible despite being very slow (i remember watching Mozilla 0.6's dialog boxes draw themselv…

If you look at the graph, you'll see that the Quantum release had no discernable impact on Firefox adoption.

In any case, it still has a number of major differentiation points - more capability for extensions is even one of them, see their Facebook Container extension. But obviously the one Google will never be able to copy is a focus on privacy.

Re: Prototype: Puppeteer for Firefox

#53
post #15

For automated testing, why Puppeteer instead of Selenium?

Just download both and try doing the same test suite. See which one hurts the least. I'm 99% sure Puppeteer will feel like a breath of fresh air to you.

CasperJS was OK, even better with Nightwatch but Puppeteer is quicker, more stable and actively developed.

Re: Prototype: Puppeteer for Firefox

#54
post #37
post #17

Earlier quoted context omitted.

Much better access to low-level information. You can hook (and mock) requests, see what POST data was sent and basically do lots of magic. Also, my experience with Selenium under Python is that doing anything bigger quickly turns into one giant timing hack.

If it really E2E from user perspective you shouldn't doing any magic and manipulate POST data.

You're not technically wrong, but unit/integration/E2E are not hard categories for tests, they're just points along a continuum.

Sometimes I want to directly control a browser to run a test or examine a UI component, but I still want to mock parts of my application. This is one of the biggest weaknesses with Selenium -- it takes a very narrow view of what testing is, so it becomes much less useful as soon as you're trying to do anything interesting.

Different applications call for different testing strategies. Selenium could be a low-level browser controller that allows you to write strict E2E tests, but instead it's a low-level browser controller that is almost fanatical about only supporting strict E2E tests, even when it means that basic actions need to be more complicated. I think that's a design mistake, but whatever.

Re: Prototype: Puppeteer for Firefox

#55
post #15

For automated testing, why Puppeteer instead of Selenium?

Selenium feels old and outdated, it's always a hustle to install it/get it running and I have to use WebdriverIO with it in Node. I tried Puppeteer a few days ago, I just did `npm i puppeteer` and it worked as expected.

Re: Prototype: Puppeteer for Firefox

#57
post #46
post #31

Earlier quoted context omitted.

How? With selenium I have a case that WebElement.click() fails but it doesn’t throw. Also Select(...).select_by_visible_text() throws WebDriverException, StaleElementException, etc even if you WebDriverWait()’d for it to be available. To me these show selenium is unreliable. How puppeteer is reliable pertaining to these cases?

It's probably because in the meantime dom nodes has been replaced by new ones. Selenium has it's quirks but when you understand how it works and it's limitations and user centric philosophy there is nothing that can stop you from writing rock solid stable tests.

Sorry I didn't defined the problems clearly and thank your for your help. I am using selenium using python for web automation, not testing. The latter problem was by and large solved by subclassing WebDriverWait by adding common Exceptions related to nodes staleness. The former problem was tackled by writing a for loop detecting changes of the context to know if WebElement.click() fails silently.

The thing is I have to write these workarounds everywhere. What's more, I inject javascript code a lot to avoid nodes staleness caused by network latency. I believe selenium is not designed for writing lots of javascript. And javascript code in a string of python can not be linted, which increases debugging workload.

To this point, the cost of these hacks is too much in my project. I find puppeteer play nicely with javascript after trying. But the difference and reliability between waitFor() in puppeteer and WebDriverWait() in selenium still remain questionable.

I am wondering if using puppeteer can ease pains mentioned above.

Re: Prototype: Puppeteer for Firefox

#58

Firefox has lost its lead because it's lost the developers. Chrome has invested massively in developer tools for chrome and it's shows.... I think chrome is the best software ever written. The developer tools are so powerful that it'd hard to even know the full breadth of what's in there. Firefox offers nothing to developers over chrome, which is sad.

> Firefox offers nothing to developers over chrome, which is sad. Firefox has multi-account containers. Having different tabs logged in to different accounts is huge for me.

I use Chrome profiles to great effect.
Post reply on HN