Posts

Showing posts with the label webdriver

Feature Toggle Integration Testing with Spring Boot

This blog explains tries to explain the following concepts: What is a feature toggle? Use case of feature toggle in real life Importance of integration testing with feature on and off What is a feature toggle? The mechanism of controlling the application's behaviour or feature during runtime using an external configuration or property is called feature toggle. Use case of feature toggle in real life Imagine you are a developer working for a telecom provider. Every time a new product or phone is launched by manufacturers, the products should not be displayed in the telecom provider's website, until it is officially launched by the manufacturers like Apple or Google. However as a telecom provider, your organisation should be able to sell or receive orders for the newly launched phones, immediately after the launch of the new phones. Hence, feature toggle becomes quite handy, where the application can be developed with new features targeting the sales of un-lau...

Headless Web Driver testing with Chrome on Headless Servers

Recently, I had a task to migrate the WebDriver based test cases from PhantomJs to Chrome headless and the tests were running on headless CI docker containers. The migration was not a smooth journey as I had anticipated and this article is based on my learning experience during this migration. PhantomJs was widely used for headless testing and now it has been unofficially abandoned by the PhantomJs team. So we had to switch to some other browser which is under active development and also which supports headless mode. The choice was Google Chrome (or Chromium). As more and more organizations move towards cloud containers or virtual machines to run their CI build, it is quite important to have the ability to run your WebDriver based tests in headless mode. My key learnings from this migration: Avoid using Xvfb (Virtual Frame Buffer) as virtual display when your test suite has hundreds of test cases.  Xvfb crashes in the middle of the test for unknown reason and Chrome fail...

Installing chromedriver for Selenium WebDriver testing

For Mac: Using homebrew: brew install --cask chromedriver chromedriver --version Using manual steps: Add the following lines to ~./bash_profile  or ~/.zprofile using vi or nano or any text editor # Installing Chrome Driver export CHROME_DRIVER_HOME=/downloaded_and_extracted_location/chrome_driver_2.33 export PATH=$CHROME_DRIVER_HOME:$PATH Verify the installation by executing the following command in Terminal chromedriver --version For Windows: Add c: \downloaded_and_extracted_location\chrome_driver_2.33\chromedriver to PATH environment variable (most probably through My Computer). Verify the installation by executing the following command in Command Prompt chromedriver --version For Ubuntu (Linux): sudo apt-get install chromium-browser sudo apt-get install chromium-chromedriver sudo ln -s /usr/lib/chromium-browser/chromedriver /usr/local/bin/chromedriver chromium-browser --version chromedriver --version For Debian (Linux): s...