Sunday 20 November 2016

Selenium Automation Framework

Selenium automation is one of the biggest favourite for automation testers. One of the key factor to deliver the automation work is to build the required framework which will reduce the time to maintain the automation scripts.

Lets find out what is Selenium automation framework in this post.

Selenium Automation Framework is setting standards to make the development, maintenance and operations simple. In other words any one who wants to run the scripts and analyse the results should not see any complexities in operations. All the complexities will be hidden in a logic and the libraries.

The first step is to find out about the application feasibility. This is very essential, remember Selenium works only with web applications and any windows based alerts will not be handled using webdriver. Autoit kind of tools are required to handle such alerts. So for any project to be successful the feasibility  study is must.

Next important step is to study the application flow. Straight forward steps and exceptional steps will be noted down and segregated. The requirement of test data for the steps are identified. Such data is more and follows the same steps each time then we will start thinking about data driven automation. Data driven steps are identified if certain type of data decides the flow and with all different sets of data the same steps are executed which results in different sets of outcome requires data driven framework.

We also need to decide how the reporting should be done. Most simple reports are biggest advantage of framework however they are most complex to build in many cases. The tools for reporting like TestNG and Junit are widely used. However if you have enough time and demand for some specific reports then HTML reports are very useful.

Now we know the framework for the project and reporting needs. We can start building library functions. These functions are as simple as opening client site, clicking on button and entering data in text field. The basic control should be targeted first.

Another important step is to create the driver and decide how do you want to call the scripts. All the library functions and client scripts should take values from property files only. This way we can make sure that the same function can be used for different operations.

Hope the above information gives basic idea of the selenium automatio framework. I will be waiting to hear from all of you.


Happy framework designing.

Saturday 12 November 2016

Security Testing

This post is dedicated to the specialised branch of software testing - Software Security Testing.

Before we get into Software Security Testing which is always part of Non Functional Testing unit we will see what are the types of Software Threats -

1. Brute Force Attack

Brute Force Attack is a vital information guessing technique. In this process automated system generates many combinations of user password or pin (personal identification number) to get into the business machines with the intention of stealing the data. These attacks are crafted very carefully so that automated system should get the access to the business systems quickly.

2. Denial of Service

This type of attack is on the critical business systems like bank, payment gateways, booking sites or critical news boards. The intention of this attack is to stop users to access the application. The attack is usually  done by the automated system by creating virtual users in exponential process with the intention of blocking available bandwidth of server to deny access to any users who need information.

3. SQL Injections

SQL Injections are the SQL queries to read, modify or delete business critical information stored in the database  using presentation layer. These attacks are easy and can be planned quickly. However these attacks are most of the time risky attacks and easy to track down.

4. Trojan Attacks

Trojan attacks are most common and easy to find. In these attacks users are presented with some of the interesting tasks like disk back up, disk fragmentation or memory management and at the background  automated scripts are executed to steal information. These attacks are successful if the user follows instructions given on the websites without confirming with the security teams.


5. Fishing

These attacks are usually crafted by sending out emails to mass users. These emails are lottery, charity or some business proposals. Users fall for this type of invitations because the offer is very lucrative and directly comes to the email inbox. The email comes with some kind of URL to hit or buttons or images to click the confirmation so that users get trapped.


Now we understand the possible attacks and threats to the business so the first task is to create test strategy to find out, in our client's business such vulnerabilities are present and if present raise an issue to fix them before the business application starts handling the user information or business critical information.

Except the fishing attack all other types of attacks are tested using penetration tools. For fishing attack we usually inform the staff and add email scanners to scan the emails coming into the business network and going out of the business network.

Open source tools used for testing above attacks are Aircrack-ng, Automatic backholing, SQLMap, pfSense and Gophish respectively.

Enjoy Security Testing!

Saturday 5 November 2016

Mobile Testing



Mobile testing or Mobile Application Testing is a complex and time consuming process. Due to the immense pressure of quicker delivery to the market, it is more critical to complete the task in less time. Let’s find out, what Mobile Application Testing is all about. 

Mobile application testing is a process where mobile application is tested for usability, functionality and consistent performance. Mobile testers use Mobile emulators to test the mobile applications. Mobile emulators help to test the application on different devices without having physical mobile phones present to test. Remember all mobile devices are on different platforms with different screen sizes.

Screenfly and CrossBrowserTesting are two easy to use screen emulators to test the mobile application. These emulators provide screens with different sizes and with different platforms like iOS and Android.

The mobile application testing can be manual or automated, however all new mobile applications usually tested manually and then through automation. The usability, application GUI, functionality are tested manually and automation is applied to performance and testing the mobile application on various devices. If the application is web application and accessible through a browser on the phone then the testing will be different. Testing mobile application which requires application installation on mobile device will be tested using multiple emulators and hence requires automation.
  
MonkeyTalk is one of the open source automation tool which is very handy to automate functional tests for iOS and Android applications. We can create data- driven tests using MonkeyTalk.

Monkey is an automation tool which runs on Android emulators and creates user events like clicks, touches or gestures.

So from the above description, we have identified that mobile application testing requires manual as well as automation testing. Due to the complex nature and many mobile devices available in the market, mobile application testing requires skills and detailed manual and automation plan.

Hope this information will help who wants to enter in mobile application testing.

Happy Mobile Testing!

  

Monday 31 October 2016

Automating using TestComplete

During Diwali, few of my friends discussed about the UFT automation tool and asked me to provide my review on any other tool which can be used for desktop, web and mobile automation. Hence I thought of writing this post on Smart bear - Test Complete.

One of my project required quicker automation to support desktop and web automation at the same time hence we reviewed the Test Complete and created the regression automation suite.

Test complete  supports JavaScript, Python, VB Script, JScript, Delphi Script, C++Script, and C#Script to create tests, however we decided to use VB Script and keyword driven framework.

 Test complete comes with Jenkins plugin which is helpful to create regression automation suite for continuous integration and delivery (CI and CD).

Another feature we liked about the tool is integration with Tortoise Subversion. The SVN is widows integrated versioning tool.

Test Complete provides built in test visualizer to capture the screenshots and object run time properties. This feature helps to understand the run time behavior of application feature.

In addition to the available plugins we can build our own plugins to support various applications. We can also create our own customized check points to verify if application with changes is working as expected.

Test Complete allows to run multiple test at the same time for desktop, web and mobile applications.

The last but definitely not the least part of tool is reporting capabilities. Test complete generates informative and easy to understand reports. We can create custom reports easily.

This automation tool for me is very easy to use tool with lot of inbuilt features and  add ins.

Keep Exploring!
    

Saturday 22 October 2016

Salesforce Automation using Selenium

Salesforce is a Software as a Service (SaaS) application. This application is cloud based and from automation it is simple web based application.

Salesforce comes with an option as Sales cloud, Service cloud or Marketing Cloud. For simplicity of this post we will limit it to Sales cloud (CRM - Customer Relationship Management). This is commonly called as SFDC - Salesforce dot com.

Selenium webdriver is useful to automate, however the application uses iframe and CSS. Hence it is essential to first find out which element properties we will be using.

Salesforce has dynamic elements and hence during automation it is always challenging to identify the correct properties and then checking the modified properties to use them. The Salesforce testing is completely depends on the quality test data. Hence in automation before we run our scripts we need to generate sufficient but quality test data. In addition, we need to remove it after execution is complete.
This way we make sure that each time Selenium script will run, it will get the right data and right elements properties.

We usually run the test data as a part of our scripts to generate the case ids. Once all the required and sufficient test data is generated, scripts will run with the scenarios and validations. After completion of execution the last part of the scripts will have cleaning up activity. This will make sure that we can use the same data generation scripts in future as well.

The driver script is required which will be called by the test runner after initialization. So before we call the driver script to run the business flows we need to place our test data generation scripts. And at the end of each business flow, we need to run the clean up script.

This application is simple and straight forward, however for automation using Selenium the major challenge is its dynamic elements and changing properties. e.g Name of the element present on the page changes as soon as it gets data filled in its other controls. This creates issue for the automation engineer who has created script using static values. The first time execution itself fails and requires to put some logic behind identifying such elements. Here we need to decide which locators we will use and for most of such dynamic controlls the best solution is to take them out in property files.

If the above considerations are already in place then the Selenium webdriver is the best and quickest automation tool for Salesforce Automation.

Keep Automating!


Sunday 9 October 2016

ServiceNow Automation using Selenium

Hello Friends, This week we will see something popular and simple to automate in Tech Ops area - ServiceNow

ServiceNow is a cloud based application. ServiceNow is a Software as a Service (SaaS). ServiceNow application is created using Angular.JS. ServiceNow is useful for Tech Ops, for primarily handling Tasks like Incident, Problem, Change, Configuration, Environment etc. ServiceNow has many other modules however we will consider only above mentioned modules for automation.

ServiceNow application is accessed using Webbrowser. Selenium web driver can be used to automate ServiceNow, however the application requires high amount of data hence the data driven and modular approach would be helpful. This kind of approach is hybrid approach for automating ServiceNow application.

Few more details of ServiceNow application: Incident is logged in ServiceNow if any service does not work as expected. For example the password does not work. Incidents are closed as soon as service is provided. For example password is reset. All such incidents require analysis to find out reducing future occurances and hence the Problem is created. Problem will be only closed after the analysis is done.  

Change is requested in case the software, hardware or network changes are required. For example if network socket needs to be changed then the change request will be raised. The change approval board will sit together and decide the approval and timelines of change. This is called as CAB approval process. When the application configuration is requested it may partially or completely affect some of the services. Configuration approval will be given only on technical details of configuration. The last one in our list is Environment. Environment like SIT, UAT, Production etc requires updates and for code drop and configuration these environments will not be available for some time as specified in request. Hence Environment ticket raised will be dealt with utmost care especially for Pre-Production and Production environment.

The above describes the ServiceNow application modules which we will automating in following sections.

Incident module is simple to automate but requires more data. Some of the information is who is raising the ticket, is it for him or for someone else or for group. His location, category, subcategory, incident description, its priority etc. Problem is comparatively simple with less data. Change has more sections and has approval process hence with more data we need more steps to executes. Also change has more test scenarios.  Configuration and Environment are simple compared to Change, the data is limited and test scenarios are also limited.

Before starting automation one more key thing is user access and previlleges. Ideally we should have user access and admin access. The user access will be used to create issues and admin to approve or resolve the issues.

As we have discussed above we will be handling more data and test scenarios, so we need to create data sheet accordingly. Once we have created data sheet as per the mandatory fields we will move on and create the common functionalities.

The last thing is to create test runner after creating driver for data sheet. Simple!

ServiceNow automation using Selenium is very simple. Isn't it?

Happy Automating ServiceNow!

Thursday 29 September 2016

Simple Environment test using VB Script

Many times you may encounter a situation where you are responsible to test the web application in test environment and need to make sure that the test environment is up and running.

I have created a simple solution to help you test multiple environments and collect the results even before you start your work.

Steps to test different environment –

1. Open web browser
2. Enter URL
3. Search web page (Depending on project requirement)
4. Capture result (Pass if webpage loaded)
5. Send out email to all stake holders

We will create a VBS file, and then create a Task in windows scheduler to run it every morning or whenever it is required

Copy the following code to notepad and save it in Environment.VBS file-
=================================================

‘This is EnvrionmentTest.VBS
 ‘This is to test if all the environments are up and running
Call Main
Function Main
    Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
    IE.Visible = True
    IE.Navigate "https://paragtestingsolutions.blogspot.co.uk"
          WScript.Sleep (1000)
if err.number = 0 then sendEmail (IE.LocationName & vbCrLf & IE.LocationURL)
End Function

Function SendEmail(eMessage)
strTo= "TestManager@Myorg.uk" 'Enter your managers email id'
strFrom="myemail@Myorg.uk"    'Enter your email id'
strSubject="Environment Test Results"
strAccountID="myaccountid"    'Enter your email account id
strPassword="myemailpwd"      'Enter your email account password
strSMTPServer="smtp.mailserver.com"

Set oEmail = CreateObject("CDO.Message")
'Message configuration
With oEmail.Configuration.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTPServer
          .item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.item("http://schemas.microsoft.com/cdo/configuration/sendusername") = strAccountID
.item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = strPassword
.Update
End With
'Message Building
With oEmail
.From = strFrom
.To = strTo
.Subject = strSubject
.TextBody = eMessage
End With
         
' send message
On Error Resume Next
oEmail.Send
If Err Then WScript.Echo "SendMail Failed:" & Err.Description
End If
wscript.sleep(5000)EndFunction
==================================================

You can store results in a variable for all the websites and pass it to Send an email as eMessage.

Now windows scheduler –

1. Click on Start => Control Panel
2. Click on System and Security => Administrative tools => Task Scheduler
3. Click on Create basic task in action pane
4. Select time to start a program
5. Program/Script Enter “cscript “ and file path
Click on finish.

After this setup you never need to inform about which environment is up and running. Every morning you will come to know which all environment are up and running and if anything is not working.   

Keep impressing!


Tuesday 27 September 2016

Assistive Application Testing

Assistive applications are computer applications specifically designed for specialized hardware used by physically challenged people.

I got the opportunity to test such software during one of our migration project. I thought this information may be helpful so sharing with you all.
Following applications are specialized applications for special people. They are well suited for windows environment.

1. Dragon

The application is from Nuance. The complete name is called as Dragon-Naturally speaking. This application helps to create professional reports, spread sheet, Documentation and Presentations with fast and accurate dictation.

Dragon is a speech recognition solution which helps to document, digital voice dictation and can be used from the workstation which does not have dragon installed through Citrix Server.  

Dragon also provides shortcuts which user can use with verbal instructions to avoid repetitive tasks.
The headphone connected to laptop is an essential gear to use Dragon. After installation user requires to create its profile, which is to tune the application for audio etc. This step is essential to make the application understand the user more accurately.

You can improve dragon’s vocabulary to help you. The words which you use often may be slangs need to be added to dragon’s vocabulary.

If the dragon is used with in work flows then we need to test the complete end to end flow with dragon commands. These commands are customized for users to handle different workflows efficiently. The commands should be easy to maintain and should be used in multiple flows.

2. JAWS

JAWS (Job Access With Speech) is a computer screen reader program for Microsoft Windows that allows blind and visually impaired users to read the screen either with a text-to-speech output or by a Refreshable Braille display.

Freedom Scientific has developed JAWS for people whose vision loss prevents them from using computer screens.

JAWS have very useful training material. With key combinations JAWS can start speaking reading screen. JAWS can be completely controlled using Keyboard keys. Windows 10 compatible version is available.

The tests are usually around reading other applications help files, PDF and Web contents. Special keyboards are used by visually impaired people.

3. Read & Write Gold

Read & write Gold is developed by texthelp. This application helps people with dyslexia. Many people use this application to get help in reading and writing at school or workplace. This is useful for anyone whose first language is not English and requires assistance to read and write.
The tests around this application are reading webpages, text documents, PDF, test files for other applications, Screen masking and adding voice notes to word etc.

The above applications are proprietary products. We are sharing our experience only from testing perspective with these applications.

We will see more testing topics in next post.

Keep reading!



Friday 16 September 2016

Telerik Test Studio

We have seen a few tools, but the client speaks about Script less automation tools. Hence I have decided to share my experience on one of the Script less automation tools - Telerik Test Studio.

Telerik test studio is one of the easiest tools to work with Functional testing, Performance, Load and Mobile testing.

Telerik test studio is very handy for web and desktop applications. One of the applications when we were automating we had issues handling Silverlight and WPF. However when we tried the same application using Telerik test studio it was quite simple.

Telerik test studio supports Silverlight, WPF, AJAX, HTML, WPF, MVC, JavaScript calls, dynamic page synchronization etc.

Telerik test studio is very simple to maintain test cases. The project explorer gives tree like structure to add test, create folder, add existing test, compile project etc.

Recording in any web browser is very simple –
                  
                  1. Click on Record
                  2. Select Browser
                  3. Enter URL and the recording will start

Recording tool bar will appear at the bottom of the browser.

This toolbar allows highlighting elements, pausing test, resuming recording and docking the toolbar.
Using Verification builder or by actions from Elements Menu, verifications can be added. Also, if you want to handle complex scenarios, then you can add coded steps to it. Telerik test studio supports C# and VB.net.

Data driven testing can be achieved with following options –

  • Using local data source
  • Excel spread sheet
  • XML
  • CSV
  •  SQL database


Test execution is very simple. Select the saved test and click on run list.

Test result panel helps to view the test summary and detailed test report. Test result shows the test steps and pass/fail results for each step.

If you want to capture the screenshots; you need to configure the test step with capture type as Browser or Desktop and File Name prefix. File name prefix will save the file on disk. For quick execution images will not be captured. This is another out of the box feature. Log files will be created and stored at the prescribed location.

So for us, initial setup and tool configuration took little while but then the recording and running tests was very simple. The maintenance part was also easy however for complex scenarios the code we created required C# or VB.net knowledge.    





Monday 5 September 2016

Rainbow Framework and Selenium Automation

One of my friends, working on Rainbow Framework requested me to write about Rainbow and Selenium automation. Hence I am writing this post.

Software systems are becoming more complex and can handle the real time data as well as process large data seamlessly with higher performance. The issue with such complex systems is maintenance. Any real time systems like IP Phones, Video conferencing, application sharing should be always up and running.

However all the systems require maintenance due to the following factors –
-      
     System issues – One of the service components suddenly stops performing bring the entire system download
-      
     Environment changes – The outside network changes distortion to the system or failures
 -     
     User Requirement- User is expecting high quality video, multiple streaming through different systems, Usage of handheld devices remotely Etc.

These things cannot stop the entire system or should not pause, so it requires some mechanism to do the self-adaption to changes and appear the system working seamlessly without service disruption.

If such bulky and complex systems will have the self-adaption logic built within the system then it will become more complex and difficult to manage. Hence such self-adaption module will be separated and kept aside. These types of arrangements are called External Mechanism.

External mechanism will have properties like Ease to maintain, Cost effectiveness and Combined (Performance, Cost and Security).

Rainbow framework fulfills all the above requirements; the rainbow framework is to divide the external mechanism software in two parts. First part is general reusable part and second part is changes to deploy on specific target.

Let’s not get into more details of Rainbow framework here; we will see applying Selenium automation with this framework.

Architectural and adaption includes components, connector types, properties and operators. This will be different software components with in system. Using Selenium Webdriver we will create a wrapper around each change and run it during each change.

Here we need to write different java functions and create wrapper to work with rainbow framework.
Let’s discuss the generic step by step process –

        1.   We will create a library file to add all the generic functions, global functions and global variables
        2.   We need to hold the time and logs
        3.   Require reporting capabilities so require report file
        4.   We need transactions file to hold the components, connector types, operators information
        5.   We will create junit / java file as runnable to run externally
        6.   We will create repository to store all the properties
        7.   We need one driver file; driver file will be called by runnable file

The Rainbow framework will change the component within predefined time using connectors and operators. If the time required is more than predefined time then this will be treated as a system failure or violation. So we need to keep the selenium script up and running after each change to test is the changes has been made as expected. Rainbow Framework provides a reusable infrastructure for architecture-based self-adaptation through its separation to two parts; general part and tailor-able part. 

Selenium code should be written in such a way that it will be verify the tailor-able part.
The selenium code eventually evolves to the extent that the framework will be completely wrapped (Functions) with the selenium code. Each tailor-able part will call the selenium script to execute and will generate the report.


Happy Scripting!


Saturday 27 August 2016

Introduction to Scrum

I have recently completed my Certified Scrum Master (CSM) course hence writing this post.

The Scrum is one framework of implementing Agile. This framework is more popular than others especially in Software development and delivery. 

Scrum is a fixed length cycle of iterative developments. Each cycle can be of 2 weeks or 1 month.These are like calendar months, which are fixed and cannot be change to 40 days or 20 days. Also like calendar months, if we do not have any work we cannot remove them. Similarly developers cannot cancel the sprint. Rather they will pull more work from backlog.

Scrum team has only 3 roles. No less. No more.

Let’s find out details of each role -


Product Owner – Business owner or Client. (Product owner cannot be BA or Any other team member. This can be Client Manager / Sr. Client Manager Etc.)

Product owner is responsible to get the value delivered in each sprint by the team members. He will be collaborative and decision maker. He should be able to inform other stake holders on overall progress and bring in the requirements in form of suggestions.

 Scrum Master – The facilitator. May not be technical person, however will make sure scrum functions as expected. He is not responsible for deliveries. He can neither take any decisions to update any feature nor stop any deliveries for quality or any other issues.  He is responsible for protecting team from external interference and checking if team is comfortable to deliver.

He is meeting organizer and helping others to follow the norms so that each meeting will be fruitful. He is a coach to impart agile values in team members.

Development Team – This is self-organised team. This team consist of all the remaining which includes BA, Architect, Developers, QA and anybody else which is required to build shippable item. The responsibilities of development team is to make sure within sprint they deliver quality item in each iteration.

Within development team BAs help to understand and prepare required documents, architect creates design; developers write code and QA test the code. These all members work closely and collaboratively. In each Sprint (2 -4 weeks) all of them work together and create a shippable product. So at the end of each sprint the Product owner if wish to release he can release the developed work.
Scrum has following ceremonies. Ceremonies can be better understood as functions to perform in each sprint (Every 2-4 weeks).

1. Sprint Planning
2. Daily Scrum meeting (Stand up)
3. Sprint review (Demo / Play back)
4. Sprint retrospective
5. Grooming


Sprint planning is 10% of the sprint time and happens at the beginning of each sprint. So if we have 2 weeks sprint, i.e. 10 days then it will be 1 day. Here all the stories (features / requirement) which can be delivered with in sprint will be pulled in Sprint backlog. The tasks for each story are created and hours of work are decided.

Daily Scrum is a daily 10 min discussion. Each development team member and scrum master answers following 3 questions –

1. What did I do yesterday?
2. What will I do today?
3. Any issues (Impediments)

Any help is available within team will be proposed but will be discussed after the scrum meeting.


Sprint review is 10% of the sprint time and happens before the end of sprint. So it will be 1 day if we have 10 days sprint. Here all the work is shown to product owner and he will accept the story if it is done.

Sprint retrospective is 10% of the sprint time and happens after the review. This meeting is to check the learning. It is generally around following questions –

1. What went well in this sprint?
2. What did not went well in this sprint?
3. What we will continue doing in next sprint?

Grooming is a meeting to discuss the product backlog. This happens during sprint and takes 10% of sprint time. In grooming team goes back to product backlog and looks at each product item to assign some high level estimates in terms of story points, this will make the list more sequenced and sorted.

If we look at the time distribution for 10 days (2 week) sprint, actual work will be carried out in 6 full working days.

As a team each one is individually responsible to update the work completed. And the burn down with remaining work is created and displayed on floor.

The basic idea of Agile is around three towers –

1. Transparency
2. Inspection
3. Adaptability


Lot of work on Scrum is created across globe. Each team alters the scrum to make it best fit; however as discussed basic concepts around it remain the same.

It will be more interesting to read more on other agile process as well.

Keep Practicing Scrum!

Thursday 18 August 2016

Automation Testing using SOAP UI

Thank you for making my blog successful. I am writing this post for those who have requested to write on SOAP UI.

SOAPUI is an open source tool for testing web services and SOA (Service Oriented Architecture). This functional testing tool is used for functional, regression and load testing.

SOAPUI is useful to create XML request and send it to server and get the response from Server.
We need WSDL to test using the SOAPUI. WSDL URL is nothing but the end point URL provided to test the web service. These endpoints are operating on messages containing information. The operations and messages are described and then bound to network protocol and message format to define and endpoint.

Once the SOAPUI is installed follow the steps given below to create test case -

1. Create New Soap Project from File Menu (Shortcut is Ctrl -N)

2. Enter Project Name

3. Enter WSDL and click OK (This is endpoint URL for testing. During actual work you may have your project specific)
(e.g. http://www.webservicex.net/CurrencyConvertor.asmx?wsdl)

4. This will create your first project to test and learn

5. Double click on Request 1and Click on (+) to add the test suite

6.  Enter name to create Test Suite and Click OK

7. Enter test case name and Click OK

8. This will ask you to enter request to test case. Enter the name. Click OK

Once the test case is created click on the RUN (Green Arrow). This will execute the test case. This will take few seconds. The request will send to the WSDL end point and the response will be received.

Now we will add some assertions. Assertions are nothing but validations. If assertion fails then the test case fails.

Once we have created all the test cases as mentioned above under the regression suite then we can run them from command prompt as well.

Testrunner.bat “C:\ParagTestBlog\SOAPTestProject.xml”

Thursday 11 August 2016

Automating Devops

Thank you all for visiting my posts frequently.

Let's see the process of Automating Devops and how testing blocks fits in the process.

Devops is development operations; which means once the code is written by developers then we need to collect the code and combine it to make larger functionality. This code is then built to make executable version and deployed in the environment i.e Test or Production. In a very simple language these all operations comes under Devops or Development Operations.

This process is repetitive and requires automation. Also, due to the changing requirements and iterative development code drop is frequent. So we need to run the code-integrate-build-deploy cycle frequently within small window.

There are two major concepts CI (Continuous Integration) and CD (Continuous Delivery). All the code when combined by the tool and sent out for build and deploy is called as Continuous Integration.  The build and deployment cycle may be manual or automated. And CD will be achieved once the code is integrated and if the build is deployed to make sure that application is ready to use after every build.

Automation testing is an essential and integral part of CI and CD. In our previous posts we have seen how Jenkins - open source tool can be used to implement CI and CD.

Selenium allows to write tests in most popular languages like Java and makes it possible to create test suites for unit testing, functional or integration testing. While automating Devops Selenium tests are triggered to make sure the functionality is working as expected. Any integration issues are not passed through and regression suite to confirm that nothing else has broken by the new code.

Any failure to the automated tests will revert the changes and inform all the stake holders. To achieve the most ideal automated system of Devops, requires expertise and willingness to provide enough time on designing the system.

Once the system is in place the maintenance of the system involves but not limited to maintaining Selenium Automation Scripts. Here if automation framework is built then it becomes easy to manage automation scripts for quick maintenance.

Hope you find this information useful.

Keep Automating!  


Thursday 4 August 2016

Quick Guide for Selenium issues


Thank you for your response. I received a few questions on Selenium so thought of answering them in this post -

Issue 1) How to handle the dynamic objects?

Solution- 
The first solution is to check if you have another locator. e.g. If you are using name locator try to use xpath.

If you do not have another useful locator then try to find out its parent locator and you can come down to the dynamic locator.  

You can also use CSS pseudo classes to walk to the dynamic object. If CSS is not a solution then last but the effective solution is to talk to developer and request to name the object. Here your good communication skills play an important part. 

Issue 2) Application is showing pop up messages?

Solution- 
Operating System level messages like print dialog box, file download dialog box etc. are outside of Selenium’s control. However most of the times you will find the controls are created for browser only and such controls are handled by Selenium. Browsers based pop up messages are easy to handle.
Send keys are not very good to use, however you may find Send keys are the only solution when other solutions don't work for pop up messages.

Issue 3) Application opens a different tab (Multi tab applications)

Solution- 
Usually if we click on hyperlink it opens into a new Window, however few applications open up a tab, for such applications you need to use send keys “Ctrl + Tab”.

Issue 4) Complex selenium scripts, difficult to maintain

Solution- 
If you have complex selenium scripts then break it in small functions. Small functions typically perform one single action like click on button / enter some value / get some elements property.

You can also add all the critical elements to repository (e.g. text file, xml file) for maintaining them outside the script. This is the simplest way of handling the object properties which keep changing frequently. Sometimes element names are different in SIT and UAT, in such cases you can make the changes to text or xml file out of the script.

Issue 5) Reporting

Solution- 
Selenium does not provide you with the reports. Hence this is the best opportunity to create your custom build reports like HTML, XML reports. Or you can use Junit / TestNG reports.

About reports, most important part is to make them very simple and user friendly. Always add date, time, and project information with environment details to your reports. You can also use SMTP emailing option to email reports. Email reports always have summary in email body and effective subject line.

Issue 6) Selenium support

Solution- 
Selenium support is available through forums so if you have issues with your code then post it to Selenium forums. And provide all details like what you are trying to do, your code and what error message you get if any. Don’t give out your conclusion and don’t expect immediate response.

Most of the time on forums you will find someone responding immediately however you can assure yourself to get the right solution you may need to wait for a day or some times for a week depending upon complexity involved.


Keep discussing!


Wednesday 27 July 2016

Tester’s role in Agile


Thank you for all the responses and requests. This post is for all of them who have requested to share some more information on “Agile” projects as well as the tester's role in the project.

While working on different projects in Agile, I have understood that the testing skills required for agile projects are tested more with in very little time. In my previous post, we have seen the skills required for testing and now we will see how these skills are applied in Agile.

Communication

In agile testing, tester is a part of development team. He will be closely working with development team to help them improve quality of the deliverables. This is a critical task and required good communication. Usually communicating to the development team and communicating to agile team is different.
Agile manifesto - Individuals and interactions over processes and tools.
Agile teams are expected to work as one unit and hence the communication between each individual team member becomes paramount important.

Business Knowledge

Within team, most of the time development team rely on the tester for quality. In agile due to quick deliveries and shorten cycles development team expects that tester should provide good reasoning for any quality issues identified. Hence business knowledge required for tester to work in Agile is less important to none.

Technical Knowledge

As tester is closely working with developers and tester is a part of the team, it becomes essential that tester understands the technical discussions. Most of the time testers are exposed to all such technical discussion and then expected to provide some thoughts from improving quality. If tester is very well aware of the technology then it is very useful to help developers to understand the quick quality issues which may otherwise surface.

Issue Resolution

Sometimes in Agile developers are ready to fix the issues within given time if the issues are recognized early in development stage. Well experienced tester can point out issues in the functionalities, design or code and also have courage to explain it to the development team.  The tester helps team to make the demo successful for acceptance of the deliverables by product owner. Any issues if found should be recorded and should have a proper schedule for rework. The success of agile team depends on the tester and his involvement in issues resolution.

Automation

All the repetitive task should be automated at the earliest possible to utilize all the available time for process improvements and quality deliverables. Most of the time functional testers involved in the Agile with no or less automation appetite will results in time consuming testing process. The overall result is not so good which is otherwise possible. Automation can be as simple as checking if the environment is ready with the automated scripts rather than manually accessing the environment. Also running sanity scripts as soon as the code is deployed.

In Agile, testing is quite different than otherwise. Tester is individual contributor as well as responsible for team’s quality deliverable.

We will see more on testing in upcoming posts. Till then,   

Keep Agile!

Thursday 21 July 2016

Myths of Software testing

Following are the some common myths of Software testing –

1. Anyone can test the application and couple of hour’s session is enough to start testing

Reality – Testing is a skill and an art. Testing is not as easy and as pie. Tester becomes great tester with experience. The tester should have qualities like Observation, Reading between the lines, Probing, Patience, Understanding perspectives, Knowledge about testing practices, Ready to dig deep,  Fearless and Strict follower of quality process.

2. Everything can be tested and application will be 100% bug free

Reality - The testing is to uncover the defects or bugs in the applications. Testing is related to cover the application functionalities with some definite scenarios. This is also called as coverage. With all the possible coverage only critical defects will be uncovered from the possible finite paths. There are always possibilities of having more combinations of inputs, process and could be different negative scenarios. These may uncover more defects and still it is not possible to assure 100% bug free applications.

3. Testing is less important than development and testing can be done any time during development lifecycle by any developer

Reality – In real world testing is as important as development or sometimes carries more value than the development. There are many examples of great looking software failing due to inadequate testing and quality checks. Developer as mentioned above will not have the art of testing and more important will not have the objective of testing. Hence developers cannot be testers unless formally trained and worked on couple of projects with actual testers. There are a few real life examples where developers who tried to enter in testing failed miserably. Testing starts early in the lifecycle, as early as the requirements are drafted. The static testing will uncover the requirement defects; here the domain experienced tester plays a critical role.

4. Everything can be automated and will not require manual testers. Any automation tool can be used to automate and QTP / Selenium are the only options to automate.

Reality – Purpose of Automation is to avoid repetitive manual tasks. If the task is not repetitive then investment on automation is not worth. For example one of the web applications required a few field validations on one of the form which manually takes 2-4 minutes, if this is automated it will take a day’s efforts, and automation tool. Such single features cannot be a candidate for automation. Technically functional testing alone cannot be considered for automation. However the regression suite can be a good candidate of automation. Manual testers will test the application manually and then those functional test cases which are critical to business will become a part of regression suite. This suite can be automated. Apart from automating regression suite few other repetitive tasks like smoke test and sanity tests can be automated.
Automation can be only feasible once the application feasibility test is done. There are many tools available in the market. Few tools are free to use and others may have some licensing fees. The application feasibility to involve but not limited to checking application technology, application environment, application architecture, deployment frequency and regression test cases are available.


  


Thursday 14 July 2016

Protractor – Open Source - End to End testing



I would like to thank each one of you for your responses to all my earlier posts. Let’s continue our journey to open source testing tools.

Recently I got a request to write on Protractor. In one of my earlier projects I got an opportunity to work on Protractor. So I am writing on Protractor in this post.

Protractor is an open source end to end Node.js framework, primarily for Angular.js web applications testing. Before we get into details of Protractor, let’s quickly look at Angular.js.  

To know Angular.js, we must know HTML, CSS and JavaScript. If you have followed my earlier post on BDD then that will help to understand the Angular.js and Protractor.

Typical webserver request – response is as given below -

 




However, the request response will load the network with heavy traffic and will result in slow websites. The solution is instead of requesting for every time for each user action; add little functionality on client side. To achieve this we have JavaScript and one of the client sides JavaScript framework is Angular.js. This way we can have interactive and fast responding webpages.
 







Above diagram simplifies the concept of fast responding web page. Within HTML pages where ever it finds directive (marker of html tag) it tells Angular to run or reference java script code. I need to stop Angular.js here as we are interested to know Protractor.

 However if you are more interested in Angular then please take a free course on Angular.js -

Now let’s move on to Protractor. As we discussed in the beginning, Protractor is an open source end to end testing framework. It will test how users will see the web application, is the communication right between backend and front end etc. This is BDD with more of a white box testing. So as shown in below diagram we will use Cucumber to write high level scenarios. These scenarios will be further using Protractor tests. Protractor tests will then send requests to Selenium server. Selenium server controls the local browser.  

Cucumber
|
  Protractor
          |
Webdriver (Selenium)
|
AngularJS App

Protractor needs following files
          1.  Spec file
          2.  Configuration file

Protractor communicates with Angular.js and waits for browser to finish the task. Hence Protractor does not need to wait or sleep. This makes it most optimized approach for automation.
Protractor allows tests to be organized based on Cucumber, thus allowing you to write both unit and functional tests on Cucumber as discussed in my previous post.

We can use Protractor on real browsers (Chrome, Firefox, and IE etc.) and headless browsers. For Protractor we need to have Selenium standalone server.
Protractor is useful if you want to test end to end however if anything fails during end to end tests, it is difficult to debug and find the issue.  

Protractor basic code is available at-
http://www.protractortest.org/#/