Why we need Coded Steps

image

Coded steps are the test steps which contain scripts or codes. In coded steps you write codes or scripts. Codes of coded steps will get executed as part of test execution. Coded steps can be very useful to automate testing of a complex unique business requirement which cannot be automated by tool. A good automated test should contain minimal numbers of coded steps.

Why we need coded steps

While automating test there may be many complex scenario which cannot be constructed using tool’s verification builder. In that scenario you may need to write codes to construct complex verification. This code will be executed with overall test as coded step. You may need to write coded steps in following scenario

  • Automating a complex verification which cannot be constructed by tool.
  • Writing Cleanup Steps. For example you may want to clean or delete all the temporary test files before or after executing test. It may be chances that tool might not able automate cleanup task. In this case you may have to write coded step for cleanup task.
  • Setting up Test Environment. You may need to set up test environment before executing test. Setting up environment may contain loading external test data, connecting to a dedicated server, loading user profile etc. It may be chances that tool might not able to set up environment for various testing scenario. In this case you may have to write coded step to set up test environment.
  • There may be complex test scenario like verifying that whether a particular file got downloaded successfully on file system or not. These types of tests are very tough to be automated by a particular tool. In this case you may have to write coded step to verify file size on file system.
  • There may be test scenario in which you need to create test data from multiple data sources. It may be chances that tool might not able to gather or mash up data from various data source. In this case you may have to write coded step to create test data.

Like above there could be many complex test scenarios which cannot be automated by tool. To automate those test scenario you will have to write codes steps.

Hybrid Application Development with students of G L Bajaj Institute of Management and Research

View Photos from Event here

image

I had exciting and overwhelming experience doing Cross Platform App Development workshop using ICENIUM with around 50 bright students of G L Bajaj Institute of Management and Research

image

In 4 hrs. Lab students learnt about

  • Thought Process behind Hybrid Application Development
  • How Hybrid Apps are different from Native Apps
  • When should one create Hybrid Apps or Native Apps
  • Introduction to Icenium
  • Managing certificates in Icenium
  • Creating package for Google Play
  • Working with Mobile layout, Mobile Views, Data etc.

Being a presenter for me it was nice and enchanting time interacting with students. In lab students learnt to create a Hybrid App for IPL.

image

Time was a constraint in the event but students were very interactive and I am sure they had learnt about new genre of mobile development that is Cross Platform Mobile Application Development.

Complex Object and RadAutoCompleteBox in XAML based Windows Store Application

Learn more about Rad Controls for Windows 8 here

In this post we will take a look on working with Complex Business object and RadAutoCompleteBox in XAML based Windows Store Application. To start with make sure that you have added RadControls for Windows 8 reference in project. To add reference right click on project and from Extensions tab select RadControls for Windows8.

image

After adding reference of RadControls for Windows 8 you need to create business object. Let us assume, we are going to work with Employee object. You need to create Employee class is as follows,

public class Employee
 {
 public string FirstName { get; set; }
 public string LastName { get; set; }
 public string Department { get; set; }

}
}

As of now you have created Employee class. Next you need to create or rather populate Employee data. There are many ways Employee data can be populated in application. Some of them are as follows,

  • From WCF SOAP Service
  • From WCF REST based Service returning either JSON or XML.
  • From OData Service etc

For purpose of this post we are going to populate data locally. Let us create a function returns collection of Employee

private List<Employee> GetEmployees()
 {
 List<Employee> lstEmployee = new List<Employee>
 {
 new Employee
 {
 FirstName = "Dhananjay",
 LastName = "Kumar",
 Department = "Team1"
 },
 new Employee
 {
 FirstName = "Dhananjay",
 LastName = "Kumar",
 Department = "Team1"
 },
 new Employee
 {
 FirstName = "Deepak",
 LastName = "Chwala",
 Department = "Team2"
 },
 new Employee
 {
 FirstName = "Amit",
 LastName = "Chawla",
 Department = "Team1"
 },
 new Employee
 {
 FirstName = "Arun",
 LastName = "Narayn",
 Department = "Team2"
 },
 new Employee
 {
 FirstName = "Bunty",
 LastName = "Goyel",
 Department = "Team1"
 },
 new Employee
 {
 FirstName = "Boman",
 LastName = "Irani",
 Department = "Team2"
 },
 new Employee
 {
 FirstName = "Charu",
 LastName = "Sharma",
 Department = "Team2"
 },
 new Employee
 {
 FirstName = "Depanker",
 LastName = "Banerjee",
 Department = "Team1"
 },
 new Employee
 {
 FirstName = "Ashok",
 LastName = "Singhal",
 Department = "Team2"
 },
 new Employee
 {
 FirstName = "Chabhi",
 LastName = "Rastogi",
 Department = "Team1"
 },

};

return lstEmployee;
 }

As of now you have collection of business object with you. Now you need to create RadAutoCompleteBox. Very first on XAML add following namespace


xmlns:tinput="using:Telerik.UI.Xaml.Controls.Input"

After adding namespace you need to add RadAutoCompleteBox on XAML a follows,


<tinput:RadAutoCompleteBox
 Height="70"
 Width="200"
 x:Name="autocompleteEmployee"
 DisplayMemberPath="FirstName">

 </tinput:RadAutoCompleteBox>

You can set one of the property of complex object as suggestion term. Above we are setting FirstName property as suggestion term.

In last step you need to set ItemSource of RadAutoCompleteBox. This can be set as following

protected override void OnNavigatedTo(NavigationEventArgs e)
 {
 autocompleteEmployee.ItemsSource = GetEmployees();

 }

Now on running application you will find RadAutoCompleteBox bind with complex object.

image

In this way you can work with complex object as RadAutoCompleteBox in XAML based Windows Store Application. I hope you find this post useful. Thanks for reading.

Setting up Samsung S3 to work with Icenium

In this post we will take a look on how could we configure Samsung S3 to work with Icenium . Icenium Graphite allows you to live sync application directly with connected device. You can directly deploy application on device and debug them. Follow below steps to configure Samsung S3 to work as development device with Icenium

Step 1

Download Samsung USB drivers for Mobile phones. You can download them from here

image

After downloading unzip file and you will get an exe. Double click to run that.

image

Step 2

Next you need to enable debug mode on device. To enable that go to Settings and then Developer Options and then Enable USB Debugging.

image

Step 3

Next you need to make sure that Android Debug Bridge is installed. By default it gets installed with Graphite. To verify this go to directory userprofile and then AppData\Local\Temp\ADB. On this directory type command ADB DEVICES. You should get your connected device listed there.

image

Step 4

Now to deploy and debug application on device select on device Run on Device. In graphite also you can see devices connected

clip_image002

In this way you can configure Samsung S3 to work with Icenium. I hope you find this post useful. Thanks for reading.

How to Read Accelerometer values in Icenium

In this post we will take a look on reading device Accelerometer values in Icenium . As we know Icenium is a Cloud based IDE works on top of Cordova or Phonegap. We will use Accelerometer API of Cordova to read device accelerometer values.

Let us say on click event of button we want to read current accelerometer value. Button can be created as following


<div id="homeview" data-role="view" data-title="Home View">
 <a data-click="GetData" data-role="button">Get Accelorometer Data</a>
 <div id="outputdiv" ></div>
 </div>

On click event of the button we will read Accelerometer values and display them in output div. On click event of button we are calling GetData JavaScript function. In GetData function we are making a call to function navigator.accelerometer.getCurrentAcceleration. In Icenium by default Phonegap reference gets added hence we do not need to add any referenced to work with cordova.


function GetData() {
 navigator.accelerometer.getCurrentAcceleration(onSuccess, onError);
 }

In onSuccess we will read accelerometer values and in onError function we will display error message.

In onSucess function we will read X, Y, Z and TimeStamp values as data.x, data.y,data.z respectively.

 function onSuccess(data) {
 var outputdiv = document.getElementById('outputdiv');
 outputdiv.innerHTML = 'X: ' + data.x + '<br />' +
 'Y: ' + data.y + '<br />' +
 'Z: ' + data.z + '<br />' +
 'Time: ' + data.timestamp;
 }

In onError function let us display error message as following

function onError() {
 alert("error occured");
 }

In this way we can read accelerometer values in Icenium. I hope you find this post useful. Thanks for reading.

How to place TabStrip at bottom of Android in Kendo UI Mobile

Recently I was in one of the event and while doing demo one question came up. Question was How to place tabstrip at bottom of Android.

Let me first explain you question in detail. While creating a Cross-Platform Mobile Application using Kendo UI Mobile and Icenium you will notice following default behavior of tabstrip and Mobile View Title.

By default in IOS, View Title will be displayed at the top and tabstrip at bottom

image

By default in Android, View Title would not be visible and tabstrip will be displayed at the top.

image

Above Layout being created with View Title, tabstrip as following,

 <div data-role="layout" data-id="applayout">
 <header data-role="header">
 <div data-role="navbar">
 <span data-role="view-title"></span>
 <a data-role="backbutton" data-align="left">Back</a>
 </div>
 </header>

<div data-role="footer">
 <div data-role="tabstrip">
 <a href="#dataview" data-icon="home">Audience</a>
 <a href="#createview" data-icon="action">Add Audience</a>
 <a href="#movieview" data-icon="download">Movies</a>
 </div>
 </div>
 </div>

Now question was how to achieve same behavior of tabstrip and view title for both IOS and Android? They wanted to achieve same behavior in Android also as of IOS. This can be very easily done by modifying some CSS. In CSS we will override default design.

.km-root .km-android .km-view {
 -webkit-box-direction: normal;
 -webkit-flex-direction: column;
}

.km-android .km-view-title
{
 visibility: visible;
}

&nbsp;

Above we are changing default tabstrip behavior for Android and forcing it to be in bottom. To display view-title we are setting visibility of view-title for android as true. Now on running application you will find tab-strip in bottom and view-title visible for android.

image

In this way you can place tabstrip at the bottom of Android. I hope you find this post useful. Thanks for reading.