Opening Right-click Menu / Context menu with Selenium WebDriver

Selenium WebDriver providesActionBuilder to perform complex user interactions with a web page. It allows chaining multiple actions together to perform a complex action. You can create a complex action and execute the action (perform) it in the following manner. (Ruby) The action to open the context menu is context_click() . ...

March 24, 2018 · Sinaru Gunawardena

Think differently when the current tests fails

This is a lesson learned from work. SO we use Rials in our project at the workplace. SP for a new requirement, we had to have a validation for a particular attribute of a model. The requirements were specific on where the validation should happen. Say for example for what controller actions. However, the initial idea was tho have the validation at the model so that it will be validated on create and update. The idea was that every controller action that matters the new attribute validation would automatically be validated. ...

April 25, 2017 · Sinaru Gunawardena

Be careful when using loops in Jasmine specs

Your test automation code is an important tool to evaluate your application. You must ensure your test code is working/testing as you want it to be. the automated tests give confidence for the developer that the application behaves as expected and things are not broken after they change the code. Recently, at our QA phase, the QA found a bug that should have been caught from our test automation. Therefore being suspicious I looked into the code. Interesting enough, the way we used loops along with test blocks were not testing as we wanted. Below is an example of a test block with the bad approach we had. Then I listed down a working approach using loops. ...

February 1, 2017 · Sinaru Gunawardena

Jasmine Best Practices

The file name should be Matching for the top level test suite name. There should be one top level test suite per file. Give a meaningful name or title for the test suite. Either use var or this to define variables that needs to use across tests. var variables should be placed just below the top describe (test suite) Use setup and teardown methods to perform common variable initializations and functionalities. A spec (test case) should test only “ONE” expectation. Group the main test suite with sub test suites to group sections. {#user-content-good-test-suite.anchor}Good Test Suite Following is a structure of a good looking Jasmine test suite. ...

February 29, 2016 · Sinaru Gunawardena