Translate

Thursday, May 12, 2016

Running a Cucumber Feature File in Eclipse

I was tasked to improve an automation test that the offshore QA team has written for our web application.
I specifically have to update this Cucumber feature file.

Feature: Verify Search functionality

   Scenario: As a default User, I should be able to see search in Account page
      Given I do a default login
      When I view "Account" tab in Home Page
      Then I verify search ui functionalities

To a more granular test that when a default user do a search and the web application's dependent web service is down, then an error message will be displayed.

  • I am a Java developer but I have no background on QA testing nor Behavioral Driven Development (BDD), Cucumber, Selenium and all these tools that the offshore team has been using in their automation tests.
  • The QA Team has very little onboarding documentation so working on a Cucumber Feature file could be tricky.
  • We have an onshore QA Manager but he has got loads on his plate at the moment.
  • I was told not to run random tests off the project because it could cause issues in the Production environment.

To accomplish my almost impossible task, here are the steps I did.
  1. Import the project from Github into an Eclipse workspace.
  2. Install Cucumber Plug-in in Eclipse At this point, when I open the Feature file, I can see the file icon changed and the file text is color-coded.
  3. I try to run the feature file by right-clicking on the file.  Run As -> Cucumber Feature.  I got an error as below:
  4. This is because the Cucumber Eclipse plugin does not have Cucumber JVM and other JAR files needed to execute feature file.  Right-click on the project.  Select Properties -> Java Build Path -> Libraries.  Add External JARS. Then select the files that you must have previously downloaded from Maven Repository:
    • cucumber-core-1.2.4.jar
    • cucumber-java-1.2.4.jar
    • cucumber-junit-1.2.4.jar
    • cucumber-jvm-deps-1.0.5.jar
    • cucumber-reporting-2.2.0.jar
    • gherkin-2.12.2.jar
    • junit-4.12.jar
    • mockito-all-2.0.2-beta.jar
    • selenium-java-2.41.0.jar
  5. I tried doing again step #3 but failed.  At this point, I found a blog post that made it work.  I created a Run Configuration.  From the menu, select Run -> Run Configuratons.. -> Cucumber Feature -> New.  Select the project you are in.  In the Arguments, enter 
  6. --glue AcceptanceTestCases src/Search.feature --format pretty
    VM arguments:
    -ea
  7. Execute this configuration and the Feature file should run smoothly.

Tuesday, May 10, 2016

Alternative to Mozilla Firefox's RESTClient

Alternative to Mozilla Firefox's RESTClient

Writing and running REST and SOAP web services has been in my daily routine at work.  My favorite plugin to execute REST calls is Firefox's RESTClient plugin.

But last week, there was an outage in our network that we had to install new certificates in our machines.  I overwrote the cacert file as advised by our DevOps so we can run our apps in our localhosts.

However, this new cert has somehow changed my Firefox settings.  As I was running Firefox RESTClient, none of the Headers were being populated when I choose any of my saved requests.

I knew something was wrong.  I exported all requests into a JSON file.  I uninstalled the plugin.  Then failed to reinstall it back again as I keep on getting "Your connection is not secure"



So I'm stuck and cannot work on my web services testing.  It's either I walk over to the DevOps team and have them checked if this was caused by the cert recently installed OR find an alternative REST Client so I can proceed with my web services testing.

I went ahead with the latter.  Below are browser plugins that I find equally or better options to Firefox's REST Client.


  1. I considered Chrome's RESTClient first. However adding authorization headers was not straightforward.





  2. Then I tried another popular Chrome plugin, PostMan.

    As soon as I hit the Authorization tab, it asks me for the Type. Basic Auth, OAuth 1.0 and OAuth 2.0 are the types I need most of the time.
  3. Another REST Client I installed was cREST Client.  But I find it too simple.  So I abandoned the idea of using it.
To wrap up, the best easy-to-use REST Client browser plugin for me is PostMan.  Although I found something wrong with it.  When I choose Basic Auth, it can only accept a Username + Password combination.
A web service that I was about to test only has a Basic Auth key.  If I have to run that web service, then I would have to move to the RESTClient.


Monday, May 9, 2016

Installing Cucumber plug-in in Eclipse from Repository

There are two ways to install Cucumber plug-in to your Eclipse.  One way is by using the Marketplace which I blogged here.
Another way is by using the Repository which is detailed below:
  1. Open Eclipse.  From the menu, select Help -> Install New Software.  Click on Add... button.
  2. In the Add Repository window.  Enter http://cucumber.github.com/cucumber-eclipse/update-site in Location field.  Enter Cucumber as the name.  Then click OK.


  3. The window below will be displayed.  Tick the check box to expand the features included in the plugin.  Click Next button.


  4. Accept the Terms of Agreement.


  5.  After a successful installation, Eclipse will ask you to restart.



  6. Once restarted, when you open a Feature file, additional commands are added in the context-menu.


How to extract Zookeeper TAR.GZ file in Windows using 7-Zip

How to extract a Zookeeper TAR.GZ file in Windows

I was about to install Zookeeper in my local machine when I found out that the installer is in GZ format.  Being a Windows user, I have to find my way on extracting the files without using Linux/Unix commands.  I have 7-zip handy.  You may also choose WinRar, GZip or other free extractor tool available.

Here are the steps I did to extract the Zookeeper installation files:

  1. Download the latest stable installer.  As of this writing, http://www-eu.apache.org/dist/zookeeper/zookeeper-3.3.6/zookeeper-3.3.6.tar.gz is the most stable one.

  2. Right-click on the file downloaded on your file system.  Select 7-Zip.  Then Open Archive.  The 7-Zip window will be opened as below.





  3. Click the Extract button.  Then provide a Copy to folder.  This will extract the TAR file in the folder provided.

  4. Double-click on the TAR file.  This will display the contents of the TAR file as shown below.

  5. Select again the zookeeper-3.3.6 directory.  This time, click the Copy button in the 7-zip buttons panel.  You will be asked to enter a valid Copy to folder.  Click OK when done.

  6. Viola!  All files will be extracted to the folder.