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!