Yeah same here, the primary reason being that those are the only two major browsers that run on Linux and can be automated using Selenium, so they can be automatically tested in CI. But there are more and more places that only actively test in Chrome, unfortunately.
I use a Java-based Selenium, which I control from Node using WebdriverIO. The latter has a selenium-standalone plugin which ships Selenium, so if you have Java installed, that should be enough. In CI, I run my tests against Selenium's Firefox and Chrome images, which has both the browsers and Selenium set up, so I can just point WDIO to those.
I am using puppeteer headless chrome now, it's not that easy to write, for example, not understanding why it failed to click on a product link no matter how I tried to catch it using different syntax, like page.$$ or page.evaluate() with Javascript and DOM api
I wonder if I should learn Java now to use selenium. I have taken a lot of time to debug all these stuff lol
nonetheless, I am considered to be inexperienced in programming field
I should note that I'm still on the previous version of WebdriverIO, so my setup is probably a little bit different. That said, it appears to say that you need to add a capabilities key to your wdio.conf.js. The documentation of that option is here.
Presumably, if you'd want it to work for Chrome and Firefox, you'd have to add something like this:
is deprecated already really, for example, desiredCapabilities is not enough, capabilities is not set and .init() has been removed as a function don't know since when. I tried to modified the code from
That's great that you figured it out, and shared it for people running into this in the future. As a tip, I'd really recommend you to look into selenium-standalone, so you don't have to start the drivers manually yourself.
I find css issues where it behaves different on chrome and Firefox, I found one just the other day where I needed a word-break on Firefox I didn't need on chrome. I think safari is closer to chrome. But yea, it not too hard these days.
Yea the issue is I get complacent and assume things will work between the browsers, when they don't. I still have to support ie11 though, edge is a dream compared to that nightmare.
Supporting Chrome and Firefox really is effectively the same thing
Can you automate firefox tests? I know puppeteer + selenium (and others) to do that on chrome but I'm not aware of an automation test framework for FF.
Wait how do you not support Safari. Safari is the nightmare browser that always has issues from my experience. There are minor things here and there that edge hasn't done for us but Safari is far and away the browser that wastes our time.
I feel all companies should at-least strive for supporting Chrome, Firefox, Safari and then at the very least IE11 with polyfills. That should give you a pretty broad spectrum, where you aren't giving anyone a super fragmented experience.
And given that they have the one platform that prevents users from using competing browser (engines), I feel like they have an obligation to stop sitting on their hands.
28
u/CantaloupeCamper Apr 08 '19 edited Apr 08 '19
At least in my situation we support Chrome and Firefox.... that are recent. We're lucky enough to be able to draw that line.
Supporting Chrome and Firefox really is effectively the same thing... at least for me. The odd man out was everyone else.