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!