Posts

Showing posts with the label gradle

Essential Gradle Commands

I use some of the gradle commands everyday in my project and many times I had to randomly search in the internet (as I don't remember these commands by heart). This article is for my personal reference, so that I don't have to search it in random places. These commands include running tests, generating binaries, filtering tests, changing property values during runtime, listing available tasks for a project, executing task in a subproject, printing dependencies information etc.. If you have reached this paragraph and your are still interested in reading further down, then happy reading.. :) For developers working on Windows platform, please replace './gradlew' with gradlew.bat in the following commands General gradle tasks List available projects ./gradlew projects List available properties ./gradlew properties List available tasks for root project and sub-project ./gradlew tasks :SomeProject:tasks --all Build a project Clean the buil...

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...