Skip to main content

Posts

Test Case Desing Approach: imperative vs declarative

Test case design is the most important part of test automation since it is the starting point of the automation code. Writing effective and efficient test case can make your code more stable and more successful. For BDD approach, the feature files hold the test cases or scenarios and these scenarios are derived by depending on the acceptance criterias written in the stories. Therefore the feature files should cover all the acceptance criteria plus some more test cases produced from exploratory testing.  The approach for the writing your scenarios can be imperative or declarative or mix of both. In this post want to explain my understanding from the design approaches and their prons and cons.  For dictionary meaning of imperative is giving authoritative command,  and declarative is taking the form of a simple statement according to the Oxford dictionary . My understanding from this explanation is that you can say "do this ..." as an imperative way or you can say

Jenkins: How to Sync Local Repository with GitLab / Trigger from GitLab

If you want to update your code in the local repository from git (gitlab, github, gitorious), you need to run git pull  into your repository. If you want to do this by Jenkins, you can create a job that can perform this action. There may be easier way to solve it but you can follow the instruction below: Create a Job to Pull the repo Jenkins > New Item > Freestyle Project > "OK" Build > Build Steps > Execute Windows Batch Command> Enter your command and save it Install GitLab Hook Plugin Jenkins > Manage Jenkins > Manage Plugins > Find Correct Plugin > Install it Create Deploy Keys on GitLab GitLab > Your Project Page > Settings > Deploy Keys > Click 'New Deploy Key' Be sure that you are changing your project settings! Create Deploy Keys and Services on GitLab GitLab > Your Project Page > Settings > Services > Click 'GitLab CI' Enter token, run the fo

Configuration of Jenkins on Windows Server for Capybara and Calabash Projects

I think the most challenging part of test automation is nowadays having Continuous Integration and one step more is having Continuous Deployment. These two terms have been a buzzwords around the software community, and everyone is talking about them but there are very few companies that can apply these. The reasons behind this can be listed as: Mis-understanding of agile and scrum Lack of "real" test engineers and Lack of Dev-ops culture  Lack of stable test environments  Lack of vision in the software industry, which saving the day is more critical than saving the future Out-of-budget, not investing on good people but investing in tools On the other hand, there are lots of open-source tools that you can just build and configure your own CI, and maybe next step goes to continuous deployment. In this post, I want to explain how you can set up CI on a Windows server. I will use the following tools/technology and language: Ruby, Gem (many Gems), Capybara, Cucumbe

Basics of Continuous Integration(CI)

Continuos Integration shortly as CI is a development practice which developers push their code frequently to the development environment and then automated build system build the code and then test it and gives feedback about the newly added code. By this way, codes are added to the main repository in a small piece which reduces the complexity and deltas between new code and the code in development environment. Developers also can reach the latest build code easily. Think that every developer pushes one time in a day, the delta is just a day but if they push one time for week then the delta is 5 times bigger, correspondingly complexity is also 5 times bigger. CI Pipeline One of the biggest problem for delivering a feature late is spending longer time for testing product and fixing defects. A classical approach tells us to test at the end of the development but it is usual that planned time is consumed during analysis and development periods. Therefore, after the develo

An Error for Selenium - Chrome vs Firefox: stale element reference

I faced an selenium error like " stale element reference " when I changed Capybara's driver to Chrome which was not occurred in webkit and firefox. This error occurs when referencing an element which is not in DOM. Chrome gives this but it doesn't appear when I use Firefox because the dynamic object is appear after the Javascript execution finishes which means that Chrome doesn't wait until javascript execution ends .  You can escape this error by checking your scenario if there is an element requiring in the DOM which is destructed by an action in the scenario or if you have loop and the DOM is updating for each iteration the object you look for changes. However in  my case, scenario is passing with FF but not Chrome which because the Chrome is passing the next step as soon as Javascript execution starts.  I just call waiting function and then assign the variable. Finally scenario is passing for both browsers.        stale element reference: element is

Small Customisation for Capybara and Calabash

One of the biggest challenge in test automation is updating existing codes. Because of the update in the development, it is very prone to have some changes for the attributes of ui elements and less likely to have some change in behaviour in actions. The second option is most of the time called as bug, otherwise if the business is changed, it could be called as a new feature. For any reasons that cause the automation code gives failures you need to update something. Sometimes I need to refresh my mind :) For easy maintenance, one of the good approach keep your codes modular. It means that each module should responsible for one job and a update problem should be solved by applying just one change in your system. Using Capybara plus Cucumber gives you this features but if you are using them professionally. For this framework, business rules are kept on Cucumber so you can update business rules from your .feature files but related update should reflect to the code. In thi

Testing WEB Sevices and Automating SOAP Services

Web Services are server and client applications to interact with rest of the world over HTTP, or sometimes over SMTP. It is written for accepting requests and giving appropriate answers for each requests. It is assumed that it returns the same response if there is no changing in the request and the condition. Therefore testing and automating Web Services are very easy. You just need to know sending and receiving data and condition, then the rest of the jobs is playing with data and assertions. Information about the  Web Services  should be present in  Web Services  documentations and it should be understandable to the people from third party system.  Web applications take to the next step with the  Web Services  because you can open your system to rest of world without requiring language specific restrictions. This makes integrity of applications very easy. To be able to integrate two or more system, you just know that you are sending some data and receiving data.  I had a t