as

Saturday, 30 May 2015

Proprietary (Licensed) software testing tools

Here is the list of all licensed software testing tools.

  1. UFT (earlier called as QTP) by HP
  2. Test Complete by Smart Bear
  3. Squish
  4. Silk Test
  5. Ranorex
  6. WinRunner by HP
  7. RFT(Rational functional tester) by IBM
  8. Test Studio by Telerik
  9. Microsoft Visual Studio Test Manager
  10. Quality Center
  11. Jira

What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

Team City - CI server Tutorial

Team City is a continuous integration server just like Jenkins.

Major features of Team City are given below.

  1. It is a licensed tool developed by Jet Brains
  2. Integration with all popular version control systems like GIT, SVN
  3. Build management and Deployment
  4. Executing the tests after deployment and alerting the stakeholders if tests fail.
In next sections, we will see how to install and set up the Team City project.



What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

Windows Power shell Tutorial

We will see below topics in Windows Power shell Tutorial.

  1. Introductions to power shell
  2. Difference between command prompt and power shell
  3. Working with files and directories
  4. Working with dates and times
  5. Understanding the commands
  6. Finding help on different commnads
  7. Working with WMI objects
  8. Working with Processes
  9. Working with strings
  10. Using .Net API in power shell
  11. Filtering, Searching and sorting the data.


What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

Windows Command Line Tutorial

In this tutorial, we are going to see below topics on Windows Command Line.

  1. Introduction to Command Line
  2. Working with files - create, delete, edit
  3. Working with folders
  4. Working with date and time
  5. Changing directory
  6. Viewing the contents of the directory
  7. Writing batch files
  8. Accepting user input in batch files
  9. Passing arguments to the batch file
  10. Running batch file from C# or Java
  11. Writing if else conditions in batch files
  12. Coding loops in batch files.
  13. Functions in batch files


What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

Not Connected - Connections are available error while connecting to WIFI

I was frustrated after being unable to connect to WiFi on that day. I was wondering why the WiFi icon in the windows notification area is grayed out with message as not connected - Connections are available.
I tried connecting to WiFi on my mobile and it worked without any issues.

So at least I got to know that network is up and running and problem lies in my laptop. After searching online for the problem I found some solutions as mentioned below.

  1. Try re-enabling the network connection.
  2. I reinstalled the wireless driver.

But the problem persisted making me more annoyed. Finally I found the problem. You would be surprised to know what had happened.
While moving the laptop, I had pressed the WiFi key on the laptop which had turned off the WiFi capabilities. I pressed the key again and I could connect to the WiFi instantly. It was so funny and frustrating.


What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

How to record the selenium automation execution

We can easily record the screen using ffmpeg tool.

Create one batch file called abc.bat and copy below commands in that file.


cd \d F:\softwares\ffmpeg-20150528-git-7206b94-win32-static\bin
del d:\blogs\abcd.flv
ffmpeg -f dshow -r 5 -i video="screen-capture-recorder" d:\blogs\abcd.flv

@echo off
set /p UserInputPath= Press any key to stop?
cd C:\%UserInputPath%

Above commands will start the recording of your test execution. To start the batch file using C#, you can use below code.

System.Diagnostics.Process.Start("d:\\blogs\\newabc.bat");

Recorded video can be very crucial in fixing the broken code.

What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

Writing the ranorex automation code without repository

If you know the xpath of the object, you can perform any operation on it using plain code without using repository. Additionally you do not even need to write the code in the Ranorex Studio. You can simply write the code in the most popular IDE in the world - Microsoft Visual Studio.
Just add the reference of the Ranorex core dll files in the project and you are ready to go!

Below code shows how I printed the value of the table cell in flex application hosted at Ranorex site

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Ranorex;
using System.Diagnostics;
namespace Ranorex
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {

           // Form x = Host.Local.FindSingle("/form[@title='Calculator']", 1000);
            //  x.Activate();

            Cell c = Host.Local.FindSingle("/dom[@domain='www.ranorex.com']//flexobject[@id='FlexExample']//Cell[@text='Maurice Smith']//..//preceding-sibling::Row//Cell[1]",2000);
            Trace.WriteLine(c.Text);
            Assert.AreEqual("Joanne Wall", c.Text, c.Text + "not matching");

        }
    }
}

What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

Friday, 29 May 2015

The action can not be completed because the folder or file in it is open in another program

Have you encountered the issue - "Folder in Use -> The action can not be completed because the folder or file in it is open in another program"


In this article, I will let you know how to solve above error. Sometimes files in the folder are used by the processes in windows system. You may not be able to figure out which process is using the folder file using task manager.

In such scenario, you can use Microsoft's process explorer tool to find out the id of the process which is causing the issue and then kill it.
To find the processes associated with the folder, just type the name of the folder in the find dialog.



What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

How to compare 2 text files in Windows

There are many tools available in the market to compare text files as shown below.

  1. Beyond Compare (Licensed tool)
  2. diff - Open source tool
  3. notepad++ compare - Open Source tool
  4. Win Merge - Open source tool
  5. online text editors - https://www.diffchecker.com/ and http://text-compare.com/

In this article, I am going to tell you how you can use beyond compare to compare the files.

Installation of Beyond Compare
You can download the trial version of Beyond Compare from the official website. Then just follow installation process.

Below image shows the home screen of Beyond Compare. On the left side you can see various options for comparison. Double click on Text Compare.


Next you will see below screen. In this screen, you can select 2 files to be compared. Beyond compare will show you the differences between 2 files in red color.
To merge the change of one file into another file, just click on the yellow arrow button and save the file.


Only negative point about beyond compare is that it's a licensed tool and you have to pay for it after trail period ends.

So you may explore open source options like
  1. diff - Open source tool
  2. notepad++ compare - Open Source tool
  3. Win Merge - Open source tool
  4. online text editors - https://www.diffchecker.com/ and http://text-compare.com/

What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

How to record your computer screen using ffmpeg

Introduction
ffmpeg is used to stream the multimedia data from one source to destination. We can record our screen or stream the screen data to multiple people online.

Installation of ffmpeg
You will need to download and install 2 things

  1. ffmpeg static build
  2. Screen Capture Recorder 

Recording the screen using ffmpeg on Window system
First you should install screen capture recorder. Next, Extract ffmpeg static build zip using 7z utility. In the extracted folder, you will find the ff-prompt.bat file. Just launch it and use below command.

 ffmpeg -f dshow -r 5 -i video="screen-capture-recorder" d:\blogs\nn3.flv

After that you can do some activities on the desktop which will be recorded and flv file will be created in d:\blog folder.

Below command can be used to create mp4 files.
 ffmpeg -f dshow -r 5 -i video="screen-capture-recorder" d:\blogs\nn4.flv

Errors while Recording the screen using ffmpeg on Window system
You may see errors saying "real time buffer too full or near to full... frames dropped" This might occur due to low memory in your computer. You can solve this problem by choosing low frame rate like below 5 using command line switch say   -r 5.

What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

Thursday, 28 May 2015

Open Source test automation tools

Here is the list of all open source testing tools.

  1. Watir
  2. Watin
  3. Canoo Web Test
  4. Selenium
  5. Bugzilla
  6. TestNG
  7. SpecFlow
  8. Gauge

Some of the issues in automation tools are given below.

  1. how webdriver works internally
  2. file upload/download dialog in IE - how to handle in Selenium
  3. After file download dialog, driver does not find any elements. Use switch.
  4. unrecognised windows socket error in fitnesse server
  5. Selenium API for  timeout is not there in Java?
  6. Waiting for text to be present in element - https://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/support/ui/ExpectedConditions.html#textToBePresentInElementValue(org.openqa.selenium.By, java.lang.String)


What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

C#.Net - Tutorial for Beginners

In this tutorial, you will study about below topics.

  1. Installation of Visual Studio
  2. Visual Studio IDE
  3. Managing extensions
  4. Managing packages using NUGET PACKAGE MANAGER
  5. Data types in C#.Net
  6. Object oriented concepts in C#.Net
  7. Handling date and time in C#.Net
  8. Comparing currency amounts in c#.net
  9. Generating random number or string in c#
  10. Random rand = new Random();    long randnum2 = (long)(rand.NextDouble() * 9000000000) + 1000000000; MessageBox.Show(randnum2.ToString());
  11. Handing files in C#
  12. Verifying the pdf files
  13. Developing console applications
  14. Developing desktop applications
  15. Developing web applications
  16. WPF and WCF in .Net
  17. Designing web Services in C#.Net
  18. Building and Deploying the applications
  19. Testing application using C#.Net - Specflow
Useful Resources are given below
  1. http://www.gerbenvanadrichem.com/quality-assurance/installing-specflow-in-visual-studio-2013-premium-and-up/
  2. http://dontcodetired.com/blog/post/Advanced-SpecFlow-Using-Hooks-to-Run-Additional-Automation-Code.aspx
  3. multiple matching binding found when going to the defination of steps in feature file
  4. Assert.Inconclusive failed. One or more step definitions are not implemented yet.
  5. specflow is not showing the successful assertion output . 
  6. How to dump data into report in specflow


What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

Microsoft testing tools

Microsoft provides many testing tools in Visual Studio IDE. In this tutorial, we will see what all tools are provided by Microsoft and which ones can be used in your projects.

  1. Unit testing framework
  2. Test Manager
  3. Team Foundation Server
  4. Test Explorer
  5. Coded UI
  6. Specflow
  7. Gauge
Before we jump on to the testing tools, let us first try to understand the visual studio editions and IDE features that could be very useful in day to day work.

Microsoft Visual Studio Editions
  1. Express Edition
  2. Community Edition
  3. Ultimate 
  4. Professional
  5. Enterprise
  6. Test Edition

Microsoft Visual Studio IDE
Now let us understand the IDE for Enterprise edition.

Microsoft Unit testing framework
Now let us understand the unit testing framework provided by Microsoft.


What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

BDD automation testing frameworks

Introduction to BDD?
BDD stands for behavior driven development. Specifications for the system are laid down in simple language that is understood by all stakeholders.

Difference between BDD and TDD.
TDD stands for Test driven development. Here developers write tests to verify that software is working as expected. But in BDD, end users or customers write the specifications which are used to verify that system behaves as per the specification.

What are BDD test automation frameworks?

  1. Jbehave
  2. Cucumber
  3. Specflow
  4. Gauge

Advantages of BDD.

  1. Tests can be written and understood by all business users.
  2. Focus is on testing the specifications stated by business users and customers.


What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

Ranorex tutorial for beginners


We will see below topics in this tutorial.
  1. Introduction to Ranorex
  2. What all kinds of applications are supported by Ranorex?
  3. Installation of Ranorex
  4. Ranorex Studio
  5. Recording and Playing Back in Ranorex.
  6. Viewing the test results
  7. Test suite in Ranorex
  8. Modules in Ranorex
  9. Using repository in Ranorex
  10. Identifying the objects without Repository
  11. Automating Desktop applications
  12. Automating Web Applications
  13. Automating Mobile Applications
  14. Designing frameworks in Ranorex
Introduction to Ranorex
Ranorex is a licensed tool to automate the dektop, web and mobile applications.

Applications supported by Ranorex
Ranorex supports all kinds of dektop (.Net, Java, flex) , web (Internet explorer, chrome, firefox, safari) and mobile application testing (Android, IOS).

Installation of Ranorex
Trial version of Ranorex can be downloaded from official website.

Introduction to testing using Ranorex Studio.

Below screenshot shows how the ranorex studio home screen looks like.


To create a new testing project, you need to click on New test Solution. To run sample projects, you can choose from the sample solutions. You can create your tests in 2 languages.
  1. C#.Net
  2. VB.Net
We have 3 views in studio.
  1. Project explorer view
  2. Module View
  3. Test Suite View
Each project can have multiple test suites and each test suite can have multiple tests with multiple modules.

Ranorex provides 2 very important tools as mentioned below.
  1. Ranorex Recorder
  2. Ranorex Spy
With Ranorex recorder, you can record your actions on the application under test and then play it back later on. 

Now let us see how we can use Ranorex Spy to identify the properties of the application objects.
Ranorex identifies elements using Ranorex xpath expressions.

Common examples of Ranorex xpath are given below.
  1. Checkbox[@Checked='false' and @Text ='abc']
  2. Form[@Caption='xyz' or @Text ='xyz']
  3. Label[@value = 'pqr']//..//..//Cell[2]   ------Searching by parent
  4. Label[@value = 'pqr']//..//following-sibling::Cell
  5. Label[@value = 'pqr']//..//preceding-sibling::Cell

What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

Brisbane - Guide for new residents, tourists and international folks

Introduction to Brisbane City
Brisbane is the third largest city in Australia and it's a capital of Queensland state. Mumbai to Brisbane One way air ticket will cost you around 35k. Most of the flights will have 1 or more stops. There is no direct flight between Mumbai and Brisbane. Travel duration is around 24 hours But may be more than that depending upon number of stops and routes. Major stops are New Delhi or Singapore or Abu Dhabi.

Where to stay?
You can stay in hotels or services apartments. Accommodation is very costly in Brisbane.
1 bed apartment rent is around 2400 AUD per month in CBD (Central Business District) city area. While it is 1600 AUD in suburbs. Studio apartments will cost you less aproximately 1000 to 1200 AUD. If you are alone, you can search for rooms on sharing basis on flatmates.com If you want to buy or rent new house, you can search it on real estate website. Many international students prefer to stay in sharing accommodations.



What to eat and where to eat?
You can find all kinds of food like chinese, thai, asian, Italian, European and Continental.

How to commute?
Public transportation is very good in Brisbane. You can buy travel go card which can be used to travel by bus, train and city cat services. You can also plan your journey using JP tool.


Living costs in Brisbane 
Monthly costs in AUD for 1 person are given below.

  1. Rent - 1600 per month (if staying in independent 3 bed room house)
  2. Food - 300
  3. Transportation - 200
  4. Phone bills and other expenses - 100

So if you have a family, you will have to pay almost 2500 AUD per month But if you are still a bachelor, you will have to shell out around 1200 AUD per month to live in Brisbane.

Work culture in Brisbane Australia.
People in brisbane usually start typical office day at around 8 AM in the morning and leave office by 4 PM. If you are a temporary worker, you will have to pay 30% of your earnings towards taxes. You need to get TFN number which is required for Tax Filing in Australia.

Places to visit in Brisbane - Major tourist attractions

  1. Mount coot-tha
  2. Museum and art gallery
  3. Botanical Garden
  4. Pine koala sanctuary
  5. Queen street mall
  6. South bank park land
  7. Wheel of Brisbane
  8. New Farm Park
  9. Story Bridge at Kangaroo Point
  10. Moreton Island
  11. Great barrier reef
  12. Sunshine Coast
  13. Gold Coast - surfers paradise, sky point observation deck, burleigh heads, currumbin, dreamworld theme park, Sea world, Springbrook national park

What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

Monday, 25 May 2015

How to add exe file in visual studio project?

During early days of learning visual studio, I encountered one issue when creating the project in visual studio 2013 community edition.

I wanted to include .exe file into my project so that whenever someone copies the project to other machine, that exe file would be available in the project folder itself.

But when I right clicked on the project folder and selected add new item, I could not find the option to add exe file.

All other file types were available in the dialog as shown below.


Later on I tried selecting other option. I right clicked on the project and selected "add existing item" option which allowed me to browse the exe file I wanted to include into the project.

Please note that you will have to select all files options to select exe file.


What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

Thursday, 21 May 2015

Linux Tutorial

List of topics in Linux tutorial are given below.

  1. Introduction to Linux
  2. Installation of Linux
  3. Ubuntu GUI
  4. Basic Linux Shell Commands - ls, cd, mkdir, rm, mv, pwd, rmdir, touch, cat, man, clear, ps
  5. Test editors and File Commands - nano, vi, emacs
  6. Pipes and Redirection - 
  7. System Commands - Shutting down or restarting the machine
  8. File Permission - CHMOD 777 filename
  9. Processes - PS
  10. Searching, Filtering, Sorting the data - cat f1 | grep xyz
  11. Job Scheduling using Crons
  12. Shell Scripting

What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

SQL Tutorial

Welcome to SQL tutorial. In this tutorial you will find all concepts of SQL.

  1. SQL Introduction
  2. Database Servers
  3. DDL Statements - Create Table with Auto Increments, Drop Table, Alter Table
  4. DCL Statements - Constraints like Not null, Identity, unique, primary key, foreign key, Check, Default
  5. DML Statements - Insert rows, Delete rows, Truncate table, Update rows, Insert into Select, Select into
  6. DQL statements - Select data from table
  7. SQL Keywords - Distinct, where, and, or, order by, select top, like, in, between
  8. SQL Keywords -Union, Minus, Group By, Having, Limit, Top, Intersect, Exists
  9. SQL -Index, sequence, nextval
  10. SQL Aliases
  11. SQL Joins - Inner, left, right, full
  12. SQL Views
  13. SQL date and time functions - dateadd, datediff, sysdate
  14. SQL Null functions
  15. SQL String Functions - ucase, lcase, mid, len, rtrim, ltrim, replace, instr, Convert, format
  16. SQL Maths and Statistical functions - avg, min. max, first, last, count, sum
  17. Advanced SQL - Rank
  18. PL-SQL - Programming constructs 

What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

Tuesday, 19 May 2015

Interview Questions for Test Analyst Jobs in Australia

Test analyst role and responsibilities
  1. Design and development of Automation frameworks.
  2. Maintain test documentation and automation frameworks.
  3. Write new test cases.
  4. Execute test cases and generate test metrics.
  5. Report bugs/ defects.
  6. Web application and mobile application testing experience.
  7. Experience in scripting and programming language (vbscript, c#, Java).
  8. Knowledge of TDD and BDD frameworks.
Do you qualify to become a Test analyst?

Usually you need to possess below skills or qualification to appear for an interview.
  1. Computer science degree or relevant experience in software testing
  2. SQL knowledge is required.
  3. Ability to collaborate and work in a team.
  4. Sound knowledge of SCM (Software configuration management tools like svn, GIT, Microsoft test manager
  5. Good communication skills
  6. ISTQB certification
Common questions asked in interview are given below.
  1. What is regression testing?
  2. What is agile methodology?
  3. What are different test management tools 
  4. What are different test automation tools and frameworks - QTP
  5. Manual Testing questions
  6. Questions for freshers are here.
  7. Software testing metrics
  8. Questions on selenium can be found on this blog.
  9. What is the meaning of continuous integration?
  10. Linux Commands and Scripting
  11. What is the difference between TDD and BDD?
  12. What is TFS (Team Foundation server?
  13. How to automate tests using Coded UI?
  14. Explain something about Octopus Deploy.
  15. Explain Microsoft visual studio test manager.
  16. How do you resolve the differences of opinions with developers?
  17. What is the process of raising the defect?
  18. What are various functions in SQL?
HR questions asked in interview are given below.
  1. What are your strong and weak points.
  2. Where do you see yourself in next 3 years?
  3. What kind of manager you would like to have?
  4. Why should we hire you?
  5. What do your friends say about you?
What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

Saturday, 16 May 2015

Selendroid - Android application testing tool

What is Selendroid?
Selendroid is an android application testing tool.

Setting up environment
  1. Download and Install Java. Set up JAVA_HOME and JRE_HOME. Download and Install Android SDK. For example - D:\Program Files\Java\jdk1.8.0_45
  2. Set up ANDROID_HOME. Also configure system path variable to include Java and Android tools. For example D:\Android\sdk
  3. Set up device (Virtual device or Android phone) on which tests have to be run. If you are using real Android phone for testing then please enable developer option by tapping on the version menu (found in settings->About device)  7 times. Once Developer option becomes visible, you should enable usb debugging. Then you can attach your device to laptop using usb cable. For the first time, your device mac address will be registered in device manager, You also need to accept a message with RSA key fingerprint to acknowledge the registration on your phone. To check that your device is up and running, you must run the command - "adb devices". This command displays all the devices attached to computer.
  4. Download Selendroid jar files and test apk application.
First program to test application using Selendroid

import io.selendroid.client.SelendroidDriver;
import io.selendroid.common.SelendroidCapabilities;
import org.openqa.selenium.WebDriver;

public class Sele {

 /**
  * @param args
  */
 public static void main(String[] args) throws Exception{
    
  WebDriver driver;
  SelendroidCapabilities x;
  x = new SelendroidCapabilities("io.selendroid.testapp:0.15.0");
  driver = new SelendroidDriver(x);

 }

}

Running First program using Selendroid
  1. Run the command java -jar selendroid.jar -aut selendroid-test.apk. You should see the server running at http://localhost:4444/wd/hub/status
  2. then run above code.

Troubleshooting Issues
  1. To fix the error - "Error occurred while resigning the app selendroid - set the Java_home to home directory.
  2. You may see error saying "The requested application under test is not configured in selendroid server. - select correct app id from url". To fix this error, make sure that you have given correct app id.
  3. emulator: ERROR: x86 emulation currently requires hardware acceleration! This error comes when you try to launch virtual device. To fix this you will need to install Intel HAXM software.

Other important points to consider -
  1. You need to download Selendroid client jar file from http://repo1.maven.org/maven2/io/selendroid/selendroid-client/0.15.0/  - download client. This is required as SelendroidDriver class and other classes are defined inside it.
  2. You can use tool at below url to inspect the application structure. http://localhost:4444/inspector

Important Android tools -
  1. Android device monitor shows all devices attached to computer and also gives details about app package name, activity name and also we can view the app structure and code
  2. With AVD Manager, we can manage android devices, attach new devices.
  3. With SDK Manager, we can install/uninstall android api packages.
  4. with chrome://inspect/#devices, you can inspect web apps in chrome - 
Below screenshot shows the device monitor.


What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

First Mobile Automation test using Appium

What is Appium?
Appium is a mobile automation testing tool used to test android and IOS applications.

Installation and Setting up of Environment for running Appium tests
Please follow below steps to set up the environment.

  1. Download and Install Java. Set up JAVA_HOME and JRE_HOME.
  2. Download and Install Android SDK. Set up ANDROID_HOME.
  3. Also configure system path variable to include Java and Android tools.
  4. Download and Extract Appium.
  5. Set up device (Virtual device or Android phone) on which tests have to be run. If you are using real Android phone for testing then please enable developer option by tapping on the version menu (found in settings->About device)  7 times. Once Developer option is made visible, you should enable usb debugging. Then you can attach your device to laptop using usb cable. For the first time, your device mac address will be registered in device manager, You also need to accept a message to acknowledge the registration on your phone.

First Program to test Calculator using Appium
You can run write your tests in any language like Java, C#.Net, PHP, Python etc. Below program uses C#.Net language.

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;
using OpenQA.Selenium.Support;
using OpenQA.Selenium;
using System.Text.RegularExpressions;

namespace Appium
{
    [TestClass]
    public class UnitTest2
    {
        [TestMethod]
        public void TestMethod1()
        {

            
        IWebDriver driver;
 DesiredCapabilities capabilities = new DesiredCapabilities();
 capabilities.SetCapability("BROWSER_Name", "Android");
 capabilities.SetCapability("VERSION", "4.4.4"); 
 capabilities.SetCapability("deviceName","yourcellname");
 capabilities.SetCapability("platformName","Android");
 
   
   capabilities.SetCapability("appPackage", "com.sec.android.app.popupcalculator");
   capabilities.SetCapability("appActivity","com.sec.android.app.popupcalculator.Calculator");
   driver = new RemoteWebDriver(new Uri("http://127.0.0.1:4723/wd/hub"), capabilities);

   //locate the Text on the calculator by using By.Name()
   driver.FindElement(By.Name("3")).Click();

   driver.FindElement(By.Name("+")).Click();
   
   driver.FindElement(By.Name("5")).Click();
   
   driver.FindElement(By.Name("=")).Click();
   IWebElement txt= driver.FindElement(By.ClassName("android.widget.EditText"));
 
   String p = txt.Text.ToString();
   String replacement = Regex.Replace(p, @"\t|\n|\r", "");
   Assert.AreEqual(replacement, "3+5=8", txt.Text);
 driver.Quit();


        }
    }
}

Running First Program to test Calculator using Appium
Please follow below steps to run above test using Appium.

  1. Launch Appium Application by double clicking on Appium exe file.
  2. Start the server.
  3. Attach your device in debug mode.
  4. Run the program and see the magic!! Calculator application is launched on your device and sum of 3 and 5 is done.


Difference between Appium and Selendroid
Appium can be used to test android as well as iOS based application. Selendroid can be used to test only Android based applications. Selendroid can test application developed using API level 17 and below. But Appium can only test application developed  using API level 17 and above. We can record steps using inspector tool in Selendroid. We can use UI automater viewer tool in Android SDK to inspect the elements of application.


What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

Friday, 15 May 2015

Positional Parameter Can not be found that accepts argument

You encounter this error in Windows Powershell saying "Positional Parameter can not be found that accepts the argument xyz".

Well the root cause of the error is that powershell command is not recognizing the parameters that are passed to it. So make sure that command is using correct arguments and right sequence.

This problem usually occurs when the directory name contains spaces.

For example -
As shown in below image, I am trying to change the directory to Visual Studio 2013. But I get the above error.


To fix this problem, I used quotation marks around directory name.



What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

Sunday, 10 May 2015

Unable to view the output in console using console.writeline

Are you facing the issue that you are unable to view the output in console in visual studio using console.writeline method?

The solution is simple. You need to run your application using Ctrl+F5 key combination.
Hope this helps.

What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

Saturday, 9 May 2015

Continuous Integration (CI)

What is Continuous Integration (CI)?
During early period of software development, most of the software projects faced the issue at the time of integration of the components with each other. When multiple people work on the same project, issues do occur during integration. It is risky, costly and time consuming to fix such issues.
To tackle above problem, Continuous integration emerged.
In continuous integration, all developers commit their code to the baseline (trunk or master) repository everyday and build servers then compile and build the code after every commit immediately. Thus, if there is any issue during integration, stakeholders are notified instantly about the failure of the build.

Best practices for the implementation of CI.
Below is the list of best practices that should be adopted for CI

  1. Central or distributed source code repository (like SVN or GIT HUB) should be maintained.
  2. All developers must check out the latest code from baseline repository everyday.
  3. Changes in the local machine code must be first tested and then committed into baseline.
  4. Each commit operation into the baseline must start build process using build servers. Build servers may use tools like maven, ant, make, gradle, nant etc.
  5. If there is a failure in the build process, all stakeholders must be notified by an email.
  6. Build servers must communicate with CI servers which will kick off the automated tests as soon as build is successful.
  7. If there are any failures in functional tests, all stakeholders must be notified by an email.
  8. If all tests pass, build must be deployed automatically using tools like Octopus Deploy

List of popular CI servers.

  1. Jenkins (Earlier Called as Hudson)
  2. Teamcity
  3. Bamboo
  4. CruiseControl
  5. Go
  6. Team Foundation Server

What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

Scrum - Agile software Development Methodology

Difference between Agile and Waterfall development model.
Before I say anything about agile, let me explain few things about traditional waterfall model. In waterfall model, phases of software development cycle (Requirement gathering, Plan, build, test, deploy) for entire product (All features) are carried out sequentially. So this is very risky approach and costly as well. Because if the any critical bug surfaces in testing phase, we need to follow all phases in the same sequence again. The cost of fixing the bug surfaced in later stages is always very high.
On the other hand, Agile software development model tries to eliminate this risk by trying to deliver the product in small increments which are tested thoroughly. Focus is on delivering small but important features in the software in iterations (Sprints). So if a product has to be built with 100 features, we will not deliver all 100 features (requirements) in one cycle. But We will select only few features (say 15) and try to deliver it in first iteration(Sprint) and repeat the process for other features in next sprints.

All right. So What is agile software development?
Agile software development model is the one in which large software product is delivered in small iterations with each iteration delivering the upgraded version of the product. Scrum is one such agile development model.

Definition of Scrum.
Scrum is a agile software development model wherein entire software product development team works in collaboration with other with daily stand up meetings (scrums) of up to 15 minutes to discuss the progress of the project, identify any hurdles in the process and share the action plan for the day.

Below image will give the clear picture of how scrum model works. Please note that product backlog contains all the features (requirements) that the end product should have. Out of these features, only few features (based upon customer expectations) are pushed into sprint backlog and intended to be completed in the next sprint.



What is Sprint?
Sprint is also called as an iteration. In scrum model, a project can have many sprints. Each sprint is usually of 2 weeks duration. Duration of the sprint could be varying. But it is always less than a month.

Each sprint has below phases.

  1. Sprint planning - Sprint backlog and work items for next sprint are identified.
  2. Actual Sprint Work of say 2 weeks - Involves daily stand up meetings (scrums) and effort
  3. Sprint retrospection - At the end of each sprint, project progress is reviewed, positive things are noted down, discussions are done to improve the process further
Stakeholders of Scrum 
There are 3 kinds of stakeholders in Scrum software development model.
  1. Software Product Owner - Customer or someone who closely works with customer 
  2. Scrum Master - the person who drives the daily stand up meetings (scrums)
  3. Software development team 

What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

Friday, 8 May 2015

GIT - the most popular version control tool user guide

Introduction to version control system (VCS)
Version control systems are used to control the changes to the files. With VCS, we can easily find out who changed which files and when. We can also recover the files at certain point of time in the past. There are mainly 2 types of version control systems as mentioned below.

  1. Centralized version control system (SVN, Clear Case, Perforce)
  2. Distributed version control system (GIT, Mercurial, Bazaar, Darcs, BitKeeper)

Before GIT came up, we had a centralized version control systems like SVN, ClearCase which stored the versions of the files on central server. The issue with the centralized VCS is that if the server goes down, we can not check out the files from the server and we are blocked. Distributed VCS like GIT solves this problem by having the entire repository on the client machines. No matter if server is down or up, you can keep working on your local copy of the files and later push your changes to the server. Multiple people can work on different branches of the repository and merge these branches later which is not possible in case of centralized VCS.

What is GIT?
GIT is free distributed version control tool that can be used to manage any software project of any size.

There are 3 states of project in GIT.

  1. Working Directory
  2. Staging Area (index)
  3. Git Directory

When we modify any files, we need to add it to the staging area. Then we need to commit the files to the git directory.

What are the features of GIT?
GIT offers many features that are not available in other version control tools like SVN, Clear Case etc.
  1. Distributed
  2. Branching 
  3. Merging
  4. Staging Area
  5. Multiple Workflows
  6. Cloning
  7. Re-basing
GIT Installation and set up

GIT can be installed from the official website. Once GIT is installed you can fire below commands to set up the user for the GIT commands.

  1. git config --global user.name "G Bush"
  2. git config --global user.email gbush@washington.com

To see your settings are applied correctly, execute below command.

  1. git config user.email
  2. git config user.name
To view all keys, you can use below command.
  1. git config --list
To view the help for any command (verb), use below command.
  1. git help config
  2. git help <verb>
  3. git help <add>
To clone the repository from server, you can use below command.
  1. git clone <url>
To track new files, to stage the modified files and to mark the files to be staged after merge conflict , we use below command.
  1. git add <file name>
To remove the file from git, fire below command.
  1. git rm <file name>
  2. git rm cached <file name>
To view who committed what and when, use below command.
  1. git log --pretty=format:"%h - %an, %ar : %s"
To unstage file, use below command.
  1. git reset HEAD <file name>
To discard the changes in file, use below command.
  1. git checkout -- <file name>
  2. Stash or branch them
To view remote repositories that are configures, use below command.
  1. git remote -v


Frequently used GIT commands
GIT has got many commands as mentioned below.

  1. git -init     #Initializes empty git repository in current directory.
  2. git status  #Check the status of the project
  3. git add xyzfile  #add a file into the repository to track in staging area.
  4. git commit -m "comments"  #commit a file from staging area to repository.
  5. git add '*.txt'  #add all text files into staging area.
  6. git log  #to view our commit history
  7. git remote add origin https://github.com/xyz.git  #to add remote repository
  8. git push  #commit changes to remote repository
  9. git pull   #pull changes from the remote repository 
  10. git diff head  #view differences from last commit.
  11. git diff --staged  #view changes that are to be committed
  12. git reset filenamexyz  #remove file from staging area  
  13. git checkout -- octocat.txt  #get rid of last changes in the file
  14. git branch ABC  #creates the branch with name ABC
  15. git branch  #shows total branches
  16. git checkout ABC  #switches to the branch with name ABC
  17. git rm '*.txt'   #remove all files from current branch and disk as well
  18. git merge ABC  #merge changes from branch ABC to Master barnch
  19. git branch -d ABC   #delete the branch ABC
Steps to push the changes to remote repository like on GITHUB or Stash.

  1. git remote add <custom name of repo>  <url of repo>
  2. git push --set-upstream <nameofrepo-say-testrepo>  <nameofbranch-say-master >
To pull the changes from the repository, you need to use below command.
  1. git remote add <custom name of repo-say-testrepo>  <url of repo>
  2. git pull <nameofrepo-say-testrepo> <nameofbranch-say-master>

GIT with GITHUB
http://rogerdudler.github.io/git-guide/

GIT with Stash
Stash is used to manage GIT repositories.

Common Questions / Issues in GIT
  1. How to recover the last committed file ?
  2. How to untrack the file that's currently being tracked?
  3. I  do not want to push some files - git update-index --assume-unchanged Localization/el-GR.js 
  4. I do not want to pull some files like .csproj and settings.settings and references 
  5. git update-index --no-assume-unchanged .gitignore
What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

Gauge with C#.Net - BDD Testing

What is Gauge?
Gauge is an open source BDD test automation framework. Gauge is used to write test specifications in business user language (Gherkin) that is very easy to learn and understand. Writing the test specifications does require you to be expert in any of the testing tools. You can write tests in simple notepad.

Features offered by Gauge.
Here is the list of features offered by Gauge.

  1. Supports multiple languages like Java, .Net, Ruby.
  2. We can execute multiple test specifications simultaneously.
  3. Plugins are available for popular IDEs like Visual Studio and IntelliJ IDEA.
  4. Finally it is free to use. 

Installation and Integration of Gauge in Visual Studio.
Now let us see how to install Gauge in Visual Studio. Before you start installing Gauge package and extension, please create a class library project in Visual Studio.


You need to follow 3 steps as mentioned below to get started with Gauge in Visual Studio.

  1. Download and Install Gauge for your operating system. 
  2. Install the Gauge.VisualStudio extension for Visual Studio. To do this, Open Visual Studio Extension Manager - Tools -> Extensions and Updates. Then Search for Gauge.VisualStudio online and install.
  3. Finally install  "Gauge.CSharp.Lib" Nuget reference. You can do this using the Nuget Package Manager which can be opened by right clicking on your visual studio project that you created earlier.


Writing Test specification using Gauge in C#.Net
When you install the Nuget reference, default gauge folder structure is created for you with one specification file having 2 scenarios.



Here is the sample specification file scenario.


Scenario contains the multiple steps. Each step is mapped to the method in the class. For example, in above test scenario, we have a step 

*say "hello" to "sagar"

This step is implemented in the class as shown below. Parameters are denoted using bracket < > symbols.


Running test scenarios in Test specification using Gauge in C#.Net
You can run test scenarios in Test specification file using Test Explorer under Test menu.
Once you open, Test explorer as shown in below image, you can run all tests or run individual scenarios by right clicking on them.
By default, there are 2 scenarios with names "First Scenario" and "Second Scenario for the specification".
I have added new scenario with name Login Scenario.

To view the output of the test execution, you can click on output link at the bottom of test explorer.
Below image shows the sample output of the test scenario execution.


Well this is just the trailer of what Gauge can do for you. There is a lot more to explore. Moreover, you can hook tests created by any tools like selenium or coded UI to Gauge easily using specifications.  Watch out this space for more on that. Happy testing.

What do you think on this topic? Please express your opinion or ask any question through comment below. You can write to me at reply2sagar@gmail.com

Sponsored Links

Popular Posts

Comments

ShareThis