Puppeteer supports Firefox now.

Puppeteer is browser test automation tool developed by Chrome Developer Team.It is announced Chrome Dev Summit 2017 first, and released at January 2018.This node based library increases popularity day by day.Puppeteer promises that ease to use , 100x faster test run , working with CI/CD pipelines like travis.To make quick intoduction to puppeteer please read my post about Puppeteer from this link

Last week , in Google I/O ,Chrome developers announced new features of Puppeteer.By virtue of collabration of Mozilla , Puppeteer now support Firefox too.It is experimental phase now and 90% of project is done.You can easily find from this link which API’s are ready.To write a script for firefox you need to change just one line after when you installed firefox-puppeteer.

const puppeteer = require('puppeteer-firefox')

Another improvement announced about mobile device profile set.Puppeteer comes with 100+ device profile to test your modern web pages with real device sizes.Also you can test your web pages with new “Offline Mode” support, without cutting your connection of device.

await page.setOfflineMode(true)

If you want to learn more depth about new features watch video in below

Adding Browser Extentions with Selenium WebDriver

When Selenium WebDriver launch a browser , it creates a new profile or options set with browser’s default features.This launched browser does not contain addons or extentions.In everytime we need to add on , which addon or extention we want to use.

Chrome

ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addExtensions( new File( "/path/to/extension.crx" )) ;
driver = new ChromeDriver(chromeOptions);

Firefox

FirefoxProfile profile = new FirefoxProfile() ; 
profile.addExtension( new File( "/path/to/addon.xpi" )) ; 
FirefoxOptions firefoxOptions = new FirefoxOptions() ; 
firefoxOptions.setProfile(profile) ; 
FirefoxDriver driver = new FirefoxDriver(firefoxOptions) ;

Install All Selenium WebDrivers with One Command

Did you ever want to install or upgrade all Selenium WebDrivers using one line commmand? On windows you can do it with a Chocolately.Chocolatey is a package manager for windows and yummy way to software installation.

Firstly , you need to install chocolately.To do it , open command prompt as an administrator then write this lines.

@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

If installation is success , now you can install drivers

choco install selenium-all-drivers 

List of installed Web Drivers

  • selenium-opera-driver
  • selenium-ie-driver
  • selenium-edge-driver
  • selenium-all-drivers
  • selenium-gecko-driver
  • selenium-chrome-driver

All Selenium Web Drivers will be installed on under “C:\tools\selenium” directory.Don’t forget to add this path as “System Environments Variable”

Upgrade

Upgrading is similar to installation , just change the install variable as upgrade.

choco upgrade selenium-all-drivers

Pull the wires of Chrome with Puppeteer

Everybody knows that , Chrome is market leader and its developer tools are better than other browsers’.It is useful for software developers and software testers.Honestly ; I’m using Mozilla Firefox more than 10 years ,but Chrome is heading straight for the top every day.

Last year , Chrome Team announced headless mode. Headless mode allows to us , running Chrome without GUI.Before that , everybody was using PhantomJs for headless test automation.Now we have got the powerful alternative to test and create automations , Puppeteer is an official tool for Chrome Headless by Google Chrome team.With Puppeteer you can use many features of Chrome Dev Tools with Chrome Headless.If it is not tl;dr for you , you can learn more on puppeteer’s GitHub page. Now , let’s get install puppeteer on our machine.

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×