Responsible Testing – Human centricity in Testing

Why responsibility in testing?

Consumers demand quality and expect more from products. The DevOps culture emphasizes the need for speed and scale of releases. As CI/CD crisscrosses with quality, it is vital to engage a human element in testing to foresee potential risks and think on behalf of the customer and the end-user.

Trigent looks at testing from a multiplicity of perspectives. Our test team gets involved at all stages of the DevOps cycle, not just when the product is ready. For us, responsible testing begins early in the cycle.

Introduce the Quality factor in DevOps

A responsible testing approach goes beyond the call of pre-defined duties and facilitates end-to-end stakeholder assurance and business value creation. Processes and strategies like risk assessment, non-functional tests, and customer experiences are baked into testing. Trigent’s philosophy of Responsible Testing characterizes all that we focus on while testing for functionality, security, and performance of an application.

Risk coverage: Assessing the failure and impact early on is one of the most critical aspects of testing. We work along with our clients’ product development teams to understand what’s important to stakeholders, evaluate and anticipate risks involved early on giving our testing a sharp focus.

Collaborative Test Design: We consider the viewpoints of multiple stakeholders to get a collaborative test design in place. Asking the right questions to the right people to get their perspectives helps us in testing better.

Customer experience: Responsible Testing philosophy strongly underlines customer experience as a critical element of testing. We test for all promises that are made for each of the customer touchpoints.

Test early, test often: We take the shift-left approach early on in the DevOps cycle. More releases and shorter release times mean testing early and testing often that translates into constantly rolling out new and enhanced requirements.

Early focus on non-functional testing: We plan for the non-functional testing needs at the beginning of the application life cycle. Our teams work closely with the DevOps team’s tests for security, performance, and accessibility – as early as possible.

Leverage automation: In our Responsible Testing philosophy, we look at it as a means to get the process to work faster and better. Or to leverage tools that can give better insights into testing, and areas to focus on testing. The mantra is judicious automation.

Release readiness: We evaluate all possibilities of going to the market – checking if we are operationally ready, planning for the support team’s readiness to take on the product. We also evaluate the readiness of the product, its behavior when it is actually released, and prepare for the subsequent changes expected.

Continuous feedback: Customer reviews, feedback speaks volumes of their experience with the application. We see it as an excellent opportunity to address customer concerns in real-time and offer a better product. Adopting the shift-right approach we focus on continuously monitoring product performance and leveraging the results in improving our test focus.

Think as a client. Test as a consumer.

Responsibility in testing is an organizational trait that is nurtured into Trigent’s work culture. We foster a culture where our testers imbibe qualities such as critical thinking on behalf of the client and the customer, the ability to adapt, and the willingness to learn.

Trigent values these qualitative aspects and soft skills in a responsible tester that contribute to the overall quality of testing and the product.
Responsibility: We take responsibility for the quality of testing of the product and also the possible business outcomes.

Communication: In today’s workplace, collaborating with multiple stakeholders, teams within and outside the organization is the reality. We emphasize not just on the functional skill sets but the ability to understand people, empathize with different perspectives, and express requirements effectively across levels and functions.

Collaboration: We value the benefits of a good collaboration with BA/PO/Dev and QA and Testing – a trait critical to understand the product features, usage models, and work seamlessly with cross-functional teams.

Critical thinking: As drivers of change in technology, it is critical to developing a mindset of asking the right questions and anticipating future risks for the business. In the process, we focus on gathering relevant information from the right stakeholders to form deep insights about the business and consumer. Our Responsible Testing approach keeps the customer experience at the heart of testing.

Adaptability & learning: In the constantly changing testing landscape, being able to quickly adapt to new technologies and the willingness to learn helps us offer better products and services.

Trigent’s Responsible Testing approach is a combination of technology and human intervention that elevates the user experience and the business value. To experience our Responsible Testing approach, talk to our experts for QA & Testing solutions.

Learn more about responsible testing in our webinar and about Trigent’s software testing services.

Accelerate CI/CD Pipeline Blog Series – Part II – Test Automation

In part I of this blog series we spoke about Continuous Testing (CT), CI CD and that Test Automation is a key to its success, how to leverage test automation to enable coverage and speed. Let’s get an in-depth understanding of why it’s essential.

Why Automation of Testing is Essential for CI CD

Code analysis tools, API testing tools, API contract testing tools, Service virtualization tools, performance assessment tools, and end-to-end automation tools are all parts of CT. However, test automation is one of the key enablers of CT as:

  • It allows us to execute tests in parallel, across multiple servers/containers, speeding up the testing process.
  • It frees engineers from repetitive tasks, enabling them to focus on value-adds.
  • It helps validate the impact of even minor changes continuously.

Characteristics of a Good Automation Framework

For test automation to be effective, it must be supported by efficient frameworks. The frameworks provide a structure and help integrate and realize the efforts of a distributed team.

  • Test frameworks must support various languages, browsers, and techniques to make them future-proof. They must possess an Agile testing environment to support the continuous delivery pipeline.
  • The testing platform must be scalable to support as many tests as needed.
  • The platform must support compatibility tests on simulated devices to cut down the cycle.
  • The environment should maximize automation, i.e., trigger tests, analyze results, and share test information across the organization, in a fully automated manner.
  • The testing platform must include security features such as encryption of test data and access control policies

Characteristics of Trigent’s AutoMate Test Automation Framework

Reinforced by globally renowned partners, Trigent’s testing focus is aligned with the current business environment and offers cost benefits, performance, and agility.

As niche test automation experts, we have significant experience in open source and commercial testing tools. Our extensive library of modular, reusable, and resilient frameworks simplifies scenario-based automation. We provide on-demand testing and next-gen scheduling.

Features and benefits
  • Accelerated script development: Script/test cases development effort reduced up to 60-80% in comparison to traditional test automation approaches. Reduces Test Scripting Complexity.
  • Modular and reusable framework components: Reduced dependency on tool-specific resources. Ability to kick-start automation quickly. It supports reusable components. Reduced Test Automation maintenance costs. Allows multi-browser, multi-device testing.
  • Easy test script maintenance: Ease of test execution. Easy to make changes and maintain scripts in the long run. Improved error and exception handling. Supports multiple scripting languages.
  • On-demand Testing: Sanity, Smoke, Integration, Regression, etc. Provides effective test data creation on the go.
  • Hybrid Model: Modular test framework built using JUnit or TestNG. Integrates with multiple test automation tools. Allows a common way of handling multiple test types.
  • Scheduling and customized reporting: Send test results to ALM. Integrates with Test Management tools to track your test plans effectively.
  • Leverages new tech trends: Leverages AI/ML utilities & tools that allow for effective Test Impact analysis and test selection. Integrates with CI/CD tools to enable automated executions. Allows parallel executions to reduce test execution time

Learn more about Trigent software testing services or test automation services

Accelerate CI/CD Pipeline Blog Series – Part 1- Continuous Testing

Given its usefulness in software development, Agile methodologies have come to be embraced across the IT ecosystem to streamline processes, improve feedback, and accelerate innovation.

Organizations now see DevOps as the next wave after Agile that enables Continuous Integration and Continuous Delivery (CI/CD).  While Agile helped streamline and automate the entire software delivery lifecycle, CI/CD goes further. CI checks the code often, and the tested chunks are integrated, sometimes several times in a single day, to create a stream of smaller and frequent releases through CD.

As a principal analyst at Forrester Research puts it succinctly: ”If Agile was the opening act, continuous delivery is the headliner. The link that enables CI/CD, however, is Continuous Testing (CT).

What is Continuous Testing?

Continuous Testing is a process by which feedback on business risks of a software release is acquired as rapidly as possible. It helps in early risk identification & incremental coverage as it’s integrated into the delivery pipeline. Continuous Testing is achieved by making test automation an integral part of the software delivery pipeline. It’s seamlessly interwoven into the software delivery pipeline (not tagged at the end).

Though CI/CD enables speed-to-market, inadequate end-to-end experience testing can turn it into a liability.  A key aspect of CT is to leverage test automation to enable coverage and speed.

Test Automation – Continuous Testing’s Secret Success Factor

Automation of tests is the key to ensure that Quality Assurance is as continuous, agile, and reliable.  CT involves automating the tests and running them early and often.  It leverages service virtualization to increase the test coverage when parts of the business functions are available at different points in time.

Automated Testing binds together all the other processes that comprise the CD pipeline and makes DevOps work. By validating changing scenarios, Smart automation helps in faster software delivery.

In part II of the blog series we will talk more about why test automation is essential for CI/CD Testing, and automation framework.

Learn more about Trigent software testing services or test automation services

Trigent excels in delivering Digital Transformation Services: GoodFirms

GoodFirms consists of researched companies and their reviews from genuine, authorized service-buyers across the IT industry. Furthermore, the companies are examined on crucial parameters of Quality, Reliability, and Ability and ranked based on the same. This factor helps customers to choose and hire companies by bridging the gap between the two.

They recently evaluated Trigent based on the same parameters, after which they found the firm excels in delivering IT Services, mainly:


Keeping Up with Latest Technology Through Cloud computing

Cloud computing technology has made the process of meeting the changing demands of clients and customers. The companies who are early adopters of the changing technologies always achieve cutting-edge in the market. Trigent’s cloud-first strategy is made to meet the clients’ needs by driving acceleration, customer insight, and connected experience to take businesses to the next orbit of cloud transformation. Their team exhibits the highest potential in cloud computing that improves business results across the key performance indicators (KPIs). The Trigent team is instilled with productivity, operational efficiency, and growth that increases profitability.

The team possesses years of experience and works attentively in the cloud adoption journey of their clients. The professionals curate all their knowledge to bring the best of services to the table. This way, the clients can seamlessly achieve goals and secure their place as a modern cloud based-enterprise. Their vigorous effort has placed them as the top cloud companies in Bangalore at GoodFirms website.

Propelling Business with Software Testing

Continuous efforts and innovations are essential for businesses to outpace in the competitive market. The Trigent team offers next-gen software testing services to warrant the delivery of superior quality software products that are release ready. The team uses agile – continuous integration, continuous deployment – and shift-left approaches by utilizing validated, automated tools. The team expertise covers functional, security, performance, usability, accessibility testing that extends across mobile, web, cloud, and microservices deployment.

The company caters to clients of all sizes across different industries. The clients have also sustained substantial growth by harnessing their decade-long experience and domain-knowledge. Bridging the gap between companies and customers and using agile methodology for test advisory & consulting, test automation, accessibility assurance, security testing, end to end functional testing, performance testing the company holds expertise in all. Thus, the company is dubbed as the top software testing company in Massachusetts at GoodFirms.

Optimizing Work with Artificial Intelligence

Artificial intelligence has been the emerging technology for many industries during the past decade. AI is defining technology by taking it to a whole new level of automation where machine learning, natural language process, and neural networks are used to deliver solutions. At Trigent, the team promises to support clients by utilizing AI and providing faster, more effective outcomes. By serving diverse industries with complete AI operating models – strategy, design, development, and execution – the firm is automating tasks. They are focused on empowering brands by adding machine capabilities to human intelligence and simplifying operations.

The AI development teams at Trigent are appropriately applying the resources to identify and govern a process that empowers and innovate business intelligence. Besides, with their help with continuous processes enhancements and AI feedback systems, many companies have been increasing productivity and revenues. Therefore, helping clients to earn profit with artificial intelligence, the firm would soon rank in the list of the artificial intelligence programming company at GoodFirms.

About GoodFirms

GoodFirms, a maverick B2B Research and Reviews Company helps in finding Cloud Computing, Testing Services, and Artificial Intelligence firms rendering the best services to its customers. Their  extensive research process ranks the companies, boosts their online reputation and helps service seekers pick the right technology partner that meets their business needs.

Why is Test Automation the Next Big Game-changer in the Insurance Industry?

In a world where technology is creating on-demand and bespoke experiences, the insurance industry is ready for disruption. Characterized until now by lengthy and manual processes and limited offerings, the industry has been quick to burst out of its protective bubble by leveraging new-age technologies including Blockchain, Artificial Intelligence (AI), extended reality, and quantum computing.

Key to accelerating this technology disruption is the InsurTech sector seen collaborating with insurance companies to facilitate nimbly and point solutions across the entire value chain. PwC Australia’s Global InsurTech report projects that the number of insurance providers partnering with InsurTechs will reach 84% between 2020 and 2022.[1]

However, in the race to transform their platforms and products, insurance companies—and their InsurTech partners—are facing several challenges. Primary among them are software and application testing challenges.

Insurers and InsurTechs experience different ‘testing’ difficulties

Digital self-service claims platforms, apps that reward policyholders based on their lifestyle and driving behaviors, and even wearables that monitor diabetes and reward condition management, are some of the trending innovations created by InsurTechs.[2] The companies behind these innovations mostly characterize themselves as digital economies. They evolve faster, are more embracing of Agile & DevOps, and have built products from the ground up are usually less complicated from the product stack that they manage. So when it comes to testing, their primary need is speed. To get to the market first, they need to identify failures, test, and evaluate faster than their competitors.

Furthermore, InsureTech players see themselves primarily as product/platform developers. This requires them to customize and dovetail their product into other complex systems. Testing, therefore, will have to extend beyond their primary product stack and include integration as well.

Insurance companies, on the other hand, have a completely different set of testing needs. Equipped with a substantial customer base, but challenged with changing customer needs, they are transforming to meet the digital, omnichannel, tailored offerings that can enrich the customer journey and experience. This leads them to integrate newer systems into their existing technology stack.

Trigent has successfully worked with several insurance companies and InsurTechs to shrink development cycles and increase the speed-to-market of applications. Contact us to know more about our AI-enabled test automation solution.

Testing needs will then have to be heavily focused on end-to-end validations to ensure that customer experiences are not compromised. Additionally, testing will also have to ensure that integration with complex legacy applications is maintained. At the same time, the performance and security of valuable customer data is not compromised when supporting their large customer bases.

Test automation—an essential tool in accelerating disruption

Test automation solves several of the above challenges. According to the World Quality Report 2019-2020[3], which surveyed 1725 CIOs and senior tech leaders, the main benefits reported were better control and transparency of test activities and detection of defects. The respondents also attributed test automation to gaining reduced test costs, test cycle time, and security risk.

For InsurTechs, like any other product innovator, deploying test automation fulfills an essential requirement—it assures improved coverage of their checks, ensuring faster release schedules. More importantly, test automation serves as a strong foundation during the integration of their product with larger insurance players. The features of a full-stack test automation framework, such as cross-technology and cross-platform readiness, and library customization, ensures that the marriage of services play with product play is effectively implemented.

Insurance companies leveraging test automation have experienced quantifiable benefits. A leading benefits administration and general insurance agency leveraged test automation software and reduced regression testing time by 85%. The process which covered 95% of the test coverage area led to a 45% reduced time-to-market rate.[4]

Test automation also plays a vital role in their transformation journey. For instance, when insurance companies are integrating new technologies, it simultaneously increases the testing workload. Vendors who manage their test outsourcing contracts are more interested in maintaining their SLAs and thus are slower in the uptake of the new changes. Test automation, essential to conduct acceptance tests is then best addressed through outside, neutral parties.

The PwC Insurance 2020 report[5] states that disruption is the new reality in the global insurance industry requiring industry players to keep pace with the sweeping social, technological, environmental, economic, and political developments that are categorizing this change. Implementing early test automation, at this juncture, will then work as the key differentiator for insurance companies and InsurTechs seeking to gain a head start in the digital ecosystems of the future.

Learn more about Trigent software testing services or test automation services

—————————————————————————————
[1] https://www.pwc.com.au/
[2] https://assets.kpmg/
[3] https://content.microfocus.com/
[4] https://www.trigent.com/
[5] https://www.pwc.co.za/en/

Getting Started – Selenium with Python Bindings

Introduction

Selenium Python binding provides a simple API to write functional/acceptance tests using Selenium WebDriver. Through Selenium Python API you can access all functionalities of Selenium WebDriver in an intuitive way. Selenium Python bindings also provide a convenient API to access Selenium WebDrivers such as Firefox, IE, Chrome, etc. The current supported Python versions are 2.7, 3.5, and above. In this blog, I will explain the Selenium 3 WebDriver API and in the next one, I will explain how to install and configure PyDev in Eclipse.

What is Python?

Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. It’s high-level built in data structures, combined with dynamic typing and binding, makes it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components together. Python’s simple, easy-to-learn syntax emphasizes readability, and, therefore reduces the cost of program maintenance. Python supports modules and packages, which encourages program modularity and code reuse. The Python interpreter and the extensive standard library are available in source or binary form, free of charge, for all major platforms, and can be freely distributed.

Related: Define, Implement, Migrate and Script Automated Tests for End-to-end Automation of Applications Spanning Multiple Technologies.

What is Selenium?

Selenium is an open-source automation tool to test your web application. You can do this in various ways. For instance:

  • Selenium supports multiple languages such as Java, C#, Python, Ruby etc..
  • Selenium has components like, IDE, WebDriver.

Downloading Python bindings for Selenium

You can download Python bindings for Selenium from the PyPI page for the Selenium package. However, a better approach would be to use pip to install the selenium package. Python 3.6 has pip available in the standard library. Using pip, you can install selenium like this: `pip install selenium’. You may consider using virtualenv to create isolated Python environments. Python 3.6 has pyvenv which is almost the same as virtualenv.

Detailed instructions for Windows users

Note: You should have an Internet connection to perform this installation.

  1. Install Python 3.6 using the MSI available in python.org download page.
  2. Start a command prompt using the cmd.exe program and run the pip command as given below to install selenium.

C:Python35Scriptspip.exe install selenium.

Advantages of Python in Selenium

  1. Compared to other languages, Python takes less time to run the script and complete the execution.
  2. Python uses indentation, not braces ({}), making it easy to understand the code flow.
  3. Python is simpler and more compact.

Simple Usage

If you have installed Selenium Python bindings, you can start using it from Python in the following way:

from selenium import webdriver
 from selenium.webdriver.common.keys import Keys
 driver = webdriver.Firefox()
 driver.get("http://www.python.org")
 assert "Python" in driver.title
 elem = driver.find_element_by_name("q")
 elem.clear()
 elem.send_keys("pycon")
 elem.send_keys(Keys.RETURN)
 assert "No results found." not in driver.page_source
 driver.close()

If you found this interesting, don’t miss my next blog, ‘Install and Configure PyDev in Eclipse’.

Read Other Selenium related blogs:

Web Application Testing with Selenium WebDriver

Introduction to Selenium with C Sharp

Appium – A Good Open Source Mobile App Testing Framework

In my opinion, in the next 5 to 10 years, nearly 50 to 60% of existing websites will be converted to mobile apps seeing how the usage of mobile apps is growing day-by-day. A challenge that will arise for mobile app developers is to test apps to ensure their performance. The offside of this is, manual testing, especially for each iteration, is an extremely cumbersome activity. Therefore, it is likely that most developers will opt for automating the software testing process.

Appium is the latest open-source framework that can be used to automate the execution of test scripts with multiple test cases for both Android and iOS platforms. Though there are a few other mobile test automation frameworks in the market, Appium has gained increasing popularity because of its simplicity.

Related: Meet the Exponential Growth, High Demand, And Requirement of Advanced Functionality with Innovation and Speed.

Appium framework can be used to automate Native, Hybrid, or Mobile browser web applications.

It works on the WebDriver JSON wire protocol.

Appium Workflow Diagram:

Appium workflow Diagram

How Appium interacts with iOS and Android Applications:

For automating iOS and Android mobile application testing, Appium uses the Apple Instrumentation library or Google UI Automator to stabilize the connection between Mac OS and iOS or Windows/Linux and Android. Instruments and UI Automator libraries provide application performance, memory analysis, and testing tools for dynamically tracing and profiling iOS and Android codes respectively.

It is a flexible and powerful tool that lets you track one or more processes and examine the collected data. In this way, instruments help you to understand the behavior of both user apps and operating systems.

Appium uses the XCTest framework which is developed by Apple in Swift or Objective-C Language.

More information about this instrument and UI Automator can be found at:

iOS – Apple Developer Tools

Android – Android UI Automator

Appium Architecture:

Appium is an HTTP server written in node.js which creates and handles multiple WebDriver sessions for different platforms like iOS and Android.

Appium starts a “test case” on the device that spawns a server and listens for proxied commands from the main Appium server. It is quite similar to the Selenium server which perceives HTTP requests from the Selenium client libraries and handles those requests in different ways depending upon the platforms. Each platform like iOS and Android follow different methods and mechanisms to run a test case on the device, and so Appium kind of hacks into it and run a test case after listening to commands from the Appium server.

Configurations that are required to run Appium on Windows:

Before download and install Appium in windows, make sure given prerequisites are fulfilled.

  1. JDK Installed
  2. Android SDK Installed
  3. Set ANDROID_HOME and Path Environment Variables
  4. Eclipse ADT Plugin Installed
  5. Node JS

Configurations that are required to run Appium on Mac:

  • Make sure to use Mac OSX version 10.7 and above
  • Firstly, you need to download the Appium app for Mac.
  • Move this app to your applications folder and then launch it using Mac Launchpad.
  • As Appium uses node.js internally, you also need to install node.js on the mac machine. This can be downloaded from http://nodejs.org/. It will download the node-v0.10.xx.pkg file which you need to install.
  • XCode 4.5 or higher version along with iPhone simulator SDK and Command Line Tools should be installed on the Mac machine.

Appium Advantages:

  1. Supports standard programming languages like Java, Ruby, C#, PHP, etc.
  2. Can be used for both iOS and Android platforms
  3. Supports automation of hybrid, native, and web mobile apps.
  4. Cross-platform
  5. Backend is Selenium; so you will get all of Selenium’s functionalities
  6. Does not require an APK for use.

Appium Disadvantages:

  1. Limited support for Android versions less than 4.1
  2. Appium documentation is not exhaustive
  3. Limited availability of tutorials.

Read Other Appium related blogs

How to Automate Testing for Android Native Apps Using Appium

Don’t miss my next blog on – Running Appium Automation Script on Android Emulators

Using Appium automation script to Check SQLite DB Content of a Device!

Automated Device Certification Testing On Cloud AWS Device Farm with Appium

Learn more about our app testing services / web app testing services

Appium Blog Series 4 – Automated Device Certification Testing On Cloud AWS Device Farm with Appium

In the following blog, I will demonstrate how to conduct a`Device Certification’ testing of an Android app manually on Cloud AWS Device Farm using Appium.

Introduction to AWS Device Farm

AWS Device Farm is an app testing service hosted on cloud infrastructure by Amazon Web Services. It allows users to test and interact with Android, iOS, and Web apps on real, physical phones and tablets of there choice.

Device Farm usage

Running Automated tests of apps with Appium and TestNG framework.

Manually running tests with real time interactions on physical devices hosted remotely on AWS.

Prerequisites to run device certification test’s on AWS Device Farm

  • Java/JDK is installed
  • Eclipse IDE is installed. TestNG is installed.
  • m2e Maven Integration for Eclipse.
  • Apache Maven latest version.
  • AWS Account and IAM User are created.
  • .APK file of android app to be tested.

Preparing Appium Java TestNG Package

  1. To create Appium Java TestNG test suite for a android app please visit my earlier blog How to Automate Testing for Android Native Apps Using Appium
  2. Create a new Maven project in Eclipse of type: maven-archetype-quickstart.
  3. Copy the Appium TestNG class created in step 1 to Maven project under src/test/java.
  4. Above Maven project with all test dependencies should be packaged in a .zip file before uploading to AWS Device Farm, and instructions for this is given in this AWS post Maven Build Process.
  5. Build and package above Maven project using the following command. mvn clean package –DskipTests=true

Maven project structure should look as below, zip-with-dependencies file should contain our test code with all dependencies.

Log in to AWS Device Farm with your IAM user account, and go to AWS Device Farm console under Mobile Services category.

Create a new project, which will serve as a logical work space foryour test runs.

After the above project is created, click on the project and create a new run.

Upload .APK file of your app, and go to the next step.

Upload zip-with-dependencies zip file present in the “target” folder of the Maven project in Eclipse as shown.

Choose devices which are compatible with the app to test.

Specify settings to simulate real-world scenarios and device configurations in the next step.

Click on “Review and start run.” In `Review and start run’ page, click “Confirm and start run”. After test run is complete, test results are shown as below.

Read Other Appium related blogs

How to Automate Testing for Android Native Apps Using Appium

Don’t miss my next blog on – Running Appium Automation Script on Android Emulators

Using Appium automation script to Check SQLite DB Content of a Device!

Appium – A Good Open Source Mobile App Testing Framework

Introduction to Selenium with C Sharp

Selenium WebDriver is a free and open-source library for automated testing web applications. Selenium tests can be written in multiple programming languages such as Java, C#, Python and Ruby and multiple browsers we execute scripts.

Prerequisite:

  • Download and install Visual Studio Frame Work.
  • Your target browser is installed, such as Chrome or Firefox.

Set up Visual Studio Solution:

Create a new project in Visual Studio Select template ‘Templates’ → ‘Visual C#’ → ‘Test’ → ‘Unit Test Project’.

Add Selenium WebDriver package to the project.

Run the following command in ‘Package Manager Console’ (selecting menu ‘Tools’ → ‘NuGet Package Manager’ → ‘Package Manager Console’).

After Selenium WebDriver is installed,  Solution References will appear like the following:

How to Create a test and run it:

  1. Add a new C# (a test) Class. Right mouse click the project name (in Solution Explorer) select ‘Add’ → ‘Unit Test’.
  2. Define the following class code to test and run it.
using System;
 using Microsoft.VisualStudio.TestTools.UnitTesting;
 using OpenQA.Selenium;
 using OpenQA.Selenium.Chrome;
 using OpenQA.Selenium.Firefox;
 using OpenQA.Selenium.Safari;

namespace TestAppDemo
{
[TestClass]
public class UnitTest2
{
static IWebDriver driverGC;
// static IWebDriver driverFF;
[AssemblyInitialize]
public static void setup(TestContext contest)
{
driverGC = new ChromeDriver(@”D:Documents StudySelenium detailschromedriver_win32″);
}
[TestMethod]
public void TestChromeDriver()
{
driverGC.Navigate().GoToUrl(“http://automationpractice.com/index.php”);
driverGC.FindElement(By.Id(“search_query_top”)).SendKeys(“CASUAL DRESSES”);
driverGC.FindElement(By.Id(“search_query_top”)).SendKeys(Keys.Enter);

}
[TestMethod]
public void TestClose()
{
driverGC.Quite();
}

}
}

Right Click on `class’ and select ‘Run Tests’.

After running successful, test case, it will show as below with pass mark:

We have to understand the below elements and their usages:

  • By Id: Finds the Webpage element by its unique control id.
  • By Name: Finds the Webpage element by the control name.
  • By Class: Finds the Webpage element by the Class name.
  • By LinkText: Finds the link element by its exact text displayed on web page
  • By partialLinkText: Finds webpage element that contains the given text
  • By TagName: Finds the Webpage element by the Tag name.
  • By XPath: This is most popular and majorly used for locating webpage element in a easiest way.
  • By CSS selector: Finds Webpage element by the CSS selectorEx.

What are the Advantages of Selenium Test using C#:

  • It is Open source.
  • It can be extended with different technologies.
  • In multiple browsers we execute scripts.
  • It supports multiple OS platforms and compatible with mobile devices.
  • Test executes within the browsers, so focus is not needed while executing the script.
  • Using Selenium Grids, you can execute tests in parallel.
  • Web Driver is faster than Selenium RC because it has simpler architecture.
  • Web Driver directly talks to the web browser whereas Selenium RC needs the help of the RC Server in order to do the same.

Disadvantages of Selenium Test:

  • It supports only web based applications.
  • It does not provide any facility for Object Repository.
  • It does not provide any facility for Recovery Scenario.
  • There is no report generation for test methods by default.
  • Users need to depend on minimum one programming language.

For more details, you can go through this click here.

Read Other Blogs related to Selenium:

Web Application Testing with Selenium WebDriver

Getting Started – Selenium with Python Bindings

Working with Test Driven Development

A technique for using automated unit test scenarios to design and decoupling of dependencies is called Test Driven Development. This technique is heavily used in Agile development methodologies. To use this technique with Visual Studio Team System, you have to understand the following topics:

  • Creating and running automated tests inside the VSTS IDE
  • Abstracting dependencies in an object-oriented world
  • Re-factoring new and old features to remove duplication in the code

The main theme of TDD is “Red, Green, Refactor.”

  • To work with TDD you must have a Test Project solution for creating new test cases in VSTS and it should reference the class library where you are adding new functionality.

Follow these steps to perform TDD:

  1. Understand the requirements of the user story and feature that you are working on.
  2. Red: Create a test and make it fail.
    1. Write the test for already existed code and change the logic of the code to make our test fail.
    2. Run the test case. It should fail. This means your test is calling the correct code and that the code is not working by properly. This is a meaningful failure, and you expect it to fail.
  3. Green: Make the test pass
    1. Initially hard code the expected return value to verify success after that write the correct logic of code to make the test pass.
    2. If you’ve written the code so that the test passes as intended, you are finished. You do not have to write more code speculatively. If new functionality is still needed, then another test is needed. Make this one test pass and continue.
    3. When the test passes, you might want to run all tests up to this point to build confidence that everything else is still working.
  4. Refactor: Change the code to remove duplication in your project and to improve the design while ensuring that all tests still pass.
    1. Remove duplication caused by the addition of the new functionality
    2. Make design changes to improve the overall solution.
    3. After each refactoring, rerun all the tests to ensure that they all still pass.

Advantages of Test-Driven Development

  • When the unit test case passes success and logic of the code is refactored to remove duplicate code.
  • The unit tests will not expire until you separate documentation and this will feedback that each component is still working.
  • TDD will help the Developer to understand the complete design and critical analysis of requirements to work with the logic of code and get an accurate result.
  • Any software developed using TDD can be maintained easily, better designed.
  • If a bug is found, the developer should create a test to reveal the bug and then modify the logic of the code until successive test run, all old bugs is verified and Reduced debugging time.

Limitations

  • Due to extensive use of test cases, all code logic is not executed success or failure properly.
  • Some Security Issues for Integration testing and Compliance testing

Read about Behavior Driven Development here.

Trigent’s experienced and versatile Quality Assurance and Testing team is a major contributor to the successful launch, upgrade, and maintenance of quality software used by millions around the globe. Our experienced responsible testing practices put process before convenience to delight stakeholders with an impressive industry rivaled Defect Escape Ratio or DER of 0.2.

Cucumber Test Automation Framework

Introduction:

Cucumber is a testing framework that helps to bridge the gap between software developers and business managers. Tests are written in plain language, based on the Behavior Driven Development (BDD) style of Given, When, Then, which anyone can understand. It is defined by a Language called “Gherkin”

Difference between TDD and BDD:

TDD: TDD (Test Driven Development) is an iterative development process. Each iteration starts with a set of tests written for a new piece of functionality.

BDD: BDD (Behavior Driven Development) is a synthesis and refinement of practices stemming from TDD. Like in TDD, in BDD also, we write tests first and then add application code.

The main objective of this automation framework is to provide the test script development environment, which is BDD based.

The major differences that we get to see here are:

  • Tests are written in plain descriptive English type grammar.
  • Tests are explained as the behavior of the application and are more user-focused.
  • Using examples to clarify requirements.

Prerequisites:

  • Install JDK and Eclipse on your machine
  • Install Cucumber in Eclipse.
  • Add J Unit to “build-path” in Eclipse.
  • Add Web Driver jar files to “build-path” in Eclipse.

What is “Gherkin”?

Gherkin is a simple, lightweight, and structured language that uses regular spoken language to describe requirements and scenarios.

Gherkin Keywords:

  • Feature: Each Gherkin file begins with a ”Feature” keyword. Feature defines the logical test functionality you will test in this feature file. e.g. if you are testing a “payment gateway”, your Feature will become “Payment Gateway”.
  • Scenario: Each Feature will contain some tests to test the feature. Each test is called a Scenario and is described using the Scenario keyword.
  • Given: Defines a “precondition” to the test.
  • When: This keyword defines the test activities that will be executed. By test action, we mean the user input action.
  • Then: This keyword defines the outcome of previous steps.
  • And: This keyword is used to add conditions to your steps.
  • But: This keyword is used to add negative type comments.
  • *: This keyword is very special. It defines the whole purpose of having Given When Then and all the other keywords.

Example:

Feature: Login Action Test
Description: This feature will test a Login and Logout functionality

Scenario 1:

Unsuccessful Login with Invalid Credentials

  1. Given User is on Homepage
  2. When User Navigate to Login Page
  3. And User enters Username and Password
  4. But The user credentials are wrong
  5. Then Message displayed Wrong Username & Password

Scenario 2: 

Successful Login with Valid Credentials

  1. Given User is on Homepage
  2. When User Navigate to Login Page
  3. And User enters Username and Password
  4. Then Message displayed Log in Successfully

Note:

  1. We need to write the “Step definition” in a java class for each and every behavior written in the ‘.feature’ file.
  2. All the web elements are declared in a Class(Objects.java) under “com.cucumber.commonlibs” package.
  3. All the constants are declared in a Class(login.java) under “com.cucumber.stepdefinition” package.
  4. The trigger of execution is declared in a Class(RunCucumberTest.java) under “com.cucumber.stepdefinition” package.

Step Definition:

  • A Step Definition is a small piece of code with a pattern attached to it.
  • In other words, a Step Definition is a java method in a class with an annotation above it. An annotation followed by the pattern is used to link the Step Definition to all the matching Steps.
  • Cucumber finds the “Step Definition” file, with the help of Glue code in Cucumber Options.

Example:

@Then("^Message displayed Login Successfully$")
 public void message_displayed_Login_Successfully() throws Throwable {
 System.out.println("Login Successfully");
 }

Advantages:

  • “Mail notification” enabled, on failure of build.
  • “Scheduled execution” can be performed.
  • Captures the “screen shots” promptly, on failure and embeds with the report.
  • Supports to run the execution, individual/suite wise.
  • OS independent and Browser independent.
  • Easy to understand.
  • Easy to use, highly flexible and above all “Free of Cost”.
  • Provides “micro-reporting”, with the statistics of passed, failed, pending, skipped, undefined and missing steps.

Power your next-gen software products through our automation testing services. Learn from our experts.

Appium Blog Series – Part 3 – Using Appium automation script to Check SQLite DB Content of a Device!

Appium is an Open Source mobile application user-interface (UI) testing framework, and is used to automate native, hybrid and web mobile apps. It enables cross-platform mobile application testing by using common API for both Android and iOS platform test scripts, thereby enhancing code-reusability.

Appium provides flexibility of writing and running automation tests in any language such as, Java, C#, PHP, Ruby, Python, Perl, Objective-C.

In the following example, we will demonstrate how to connect to Android SQLite database via Appium script using core Java, JDBC, and run SQL Queries to perform data validation checks.

About SQLite database:

SQLite is the default database engine on Android, which is an open source, lightweight transactional database that stores app data to a text file with a file extension .db, on the device. To access this .db file via Appium scripts, we first need to pull the .db file to our local machine. The steps to achieve this are listed below:

  • Download eclipse plugin, com.questiod.sqlitemanager.jar and save in your eclipsedropins folder and restart eclipse.
  • Download latest version of sqlite-jdbc-x.x.x.jar, and add it to java build path in eclipse, by right clicking on project > Properties > Java Build Path > Libraries > Add External JARs >
  • I have a sample sqlite database on my device with name book.db, and it has 1 table Title with 4 records as shown below. Connect Android Device to laptop/computer In USB Debugging mode.
  • In eclipse, click DDMS icon shown below, and select book.db file as shown in below file location on device, click import icon highlighted below to pull this file from device and save it to a folder in pc.

The following code snippet opens a jdbc connection to sqlite database book.db, and run’s select sql query to fetch data from Title table and print results to eclipse console.

Connection con = null;
 Class.forName("org.sqlite.JDBC");
 //create a jdbc connection to book.db located in below file path
 con = DriverManager.getConnection("jdbc:sqlite:E:\test\book.db");
 con.setAutoCommit(false);

Statement sqlstmt = null;
//using above connection, create a statement object
sqlstmt = con.createStatement();
//run select sql query on Title table, and store results in Resultset.
ResultSet res = sqlstmt.executeQuery(“select * from Title;”);
//iterate for all data in Title table and print it.
while (res.next()) {
int BookId = res.getInt(“BookId”);
String BookName = res.getString(“BookName”);
String BookAuthor = res.getString(“BookAuthor”);
System.out.println(“BookId = ” + BookId);
System.out.println(“BookName = ” + BookName);
System.out.println(“BookAuthor = ” + BookAuthor);
System.out.println();
}
res.close();
sqlstmt.close();
con.close();

Read Other Appium related blogs

How to Automate Testing for Android Native Apps Using Appium

Don’t miss my next blog on – Running Appium Automation Script on Android Emulators

Automated Device Certification Testing On Cloud AWS Device Farm with Appium

Appium – A Good Open Source Mobile App Testing Framework

Learn more about Trigent’s automation testing services.

Continuous Integration with Jenkins

Continuous Integration (CI) is a software development practice at Trigent where members of development teams integrate their work frequently using the agile methodology. Integration testing can range from once to several times daily. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible. The main aim of CI is to provide instant feedback when a defect is found in the code so that the defect can be rectified as soon as possible.

The agile development cycle followed by CI is Code>>Build>>Test>>Deploy which helps to have high quality and bug-free code.

CI runs have two major phases:

Step One – ensures code compiles.

Step two – ensures the code works as designed.

For best results, these two phases should be followed by running a series of automated tests that validate all levels of a product.

Advantages of CI

  • Bug fixes are detected immediately
  • Debugging becomes less time consuming
  • There is no integration testing step, which saves time
  • Less expensive bug fixes
  • Since code is committed frequently, roll-back is easier in case of any major issues
  • Makes code robust and speeds up the development in an agile environment

Jenkins

Jenkins is an open-source tool to perform continuous integration. Jenkins is great at finding issues in software early. The main aim of Jenkins is to build when an event has occurred. For example, ‘build after every few minutes’ or ‘build after every commit’. Jenkins also monitors test execution and sends out notifications when a build has passed or failed.  It builds and tests your software continuously and monitors the execution and status of jobs, making life easier for the team and identifies issues at the earliest. Jenkins is a highly configurable system and also supports lots of plug-ins

Jenkins Advantages

  • We can configure build-to-run periodically
  • Once a project is successfully created in Jenkins, all future builds are automatic
  • Jenkins comes with basic reporting features, i.e. keeping track of build status, last success/failure, and so forth.
  • Deploys code instantly, no developer builds
  • Generates test reports
  • Notifies stakeholders of build status
  • A large number of plugins supported on Jenkins

Automated Continuous Regression Testing

Regression Testing becomes a challenge if defects are not found in the initial stages. A major concern when developing new software features is that another part of the code will be affected in unexpected ways. With a typical development process, testers often do not get time to execute a full set of regression tests until late in the release when it is much more costly to fix and retest the product. Continuous integration pairs continuous builds with test automation to ensure that each build also assesses the quality of the codebase. Continuous Regression runs on a daily basis in the background so that we can identify issues caused by new commits.

Appium Blog Series – Part 2 – Running Appium Automation Script on Android Emulators

About Appium

Appium is an Open Source mobile application UI testing framework, used to automate native, hybrid and web mobile apps. It enables cross-platform mobile app testing by using common API for both Android and iOS platform test scripts, thereby enhancing code-reusability. Appium provides flexibility of writing and running automation tests in any language such as, Java, C#, PHP, Ruby, Python, Perl, Objective-C.

About Android Emulator

Without an Android device, we can still run automation tests of Android Native App’s using an Emulator which mimics the OS and hardware of an Android device on a computer.

In Android SDK folder, there is an interface called as AVD Manager, which creates a virtual mobile device (Emulator) to run on a computer. Running Emulator starts a virtual console in which we can install Android apps.

In the following example, I will demonstrate automation of Android mobile phone’s default installed calculator app on Android Emulator.

Prerequisites for running Appium automation test for a native Android app on Emulator:

  • Java/JDK is installed and path for JAVA_HOME is set on the windows system.
  • Android SDK is installed and required packages of Android API’s are downloaded in SDK Manager.
  • Intel HAXM is installed.
  • Appium is installed.

Start Android Emulator:

In SDK folder on computer, run AVD Manager.exe, AVD Manager Dialog as shown below:

Click Create button, enter below details to create a new AVD.

AVD Manager shows newly created AVD as below, select this AVD and click Start.

In Launch Options dialog click Launch and in 10 to 15 minutes, Android Emulator will be started as below.

In eclipse create a Java project, with package name Android and class name AndroidEmulatorCalculator.

Set Desired Capabilities:

Following code snippet in AndroidEmulatorCalculator class, sets Desired Capabilities for Calculator App.

// Created object of DesiredCapabilities class.
 DesiredCapabilities capabilities = new DesiredCapabilities();

//Set android deviceName desired capability to Android Emulator.
capabilities.setCapability(“deviceName”, “Android Emulator”);

//Set BROWSER_NAME desired capability to Android.
capabilities.setCapability(“browserName”, “Android”);

//Set android VERSION from device desired capability.
capabilities.setCapability(“platformVersion”, “6.0”);

// Set android platformName desired capability to Android.
capabilities.setCapability(“platformName”, “Android”);

// Set android appPackage desired capability.
capabilities.setCapability(“appPackage”, “com.android.calculator2”);

// Set android appActivity desired capability.
capabilities.setCapability(“appActivity”, “com.android.calculator2.Calculator”);

Android Driver:

Following code snippet Creates an object of AndroidDriver class with Desired Capabilities as mentioned above and sets Appium server address with port number, and launches Android calculator app on device.

AndroidDriver driver;
 driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);

The code snippet given below shows a simple addition on calculator app by using id tag to locate calculator app elements.

driver.findElement(By.id("com.android.calculator2:id/digit_4")).click();
 driver.findElement(By.id("com.android.calculator2:id/op_add")).click();
 driver.findElement(By.id("com.android.calculator2:id/digit_8")).click();
 driver.findElement(By.id("com.android.calculator2:id/eq")).click();
 String result = driver.findElement(By.className("android.widget.EditText")).getText();
 System.out.println("Result of Addition is : " + result);

Run Automation Test

Start Appium server, and run AndroidEmulatorCalculator class as TestNG test. Automation test will open calculator app on Emulator, clicks on buttons in this sequence -> 4, +, 8 and =.

Gets result from text area of calculator app, and print it in eclipse console.

Learn more why trigent is one of the best automation testing companies.

Read Other Appium related blogs

How to Automate Testing for Android Native Apps Using Appium

Using Appium automation script to Check SQLite DB Content of a Device!

Automated Device Certification Testing On Cloud AWS Device Farm with Appium

Appium – A Good Open Source Mobile App Testing Framework

Web Application Testing with Selenium WebDriver

Selenium WebDriver is a popular Open Source tool used for the automation of web applications. It is a simple, concise programming interface that supports dynamic web pages where the elements of a page may change before the page reloads. It overcomes the limitations of Selenium RC and its unique value proposition is its ability to drive the web browser using the native support of browser for automation.

WebDriver is the main interface in Selenium using which tests are written. This interface is implemented by various classes as listed below
  • FirefoxDriver
  • Chrome Driver
  • InternetExplorerDriver
  • SafariDriver
  • RemoteWebDriver
  • EventFiringWebDriver
  • HtmlUnitDriver
  • AndriodDriver

Selenium WebDriver is available in several programming languages such as Java, C#, Ruby, Perl, Python, and PHP. We can use the programming language of our choice when using Selenium.

In this blog, I am focusing on the features provided by Selenium for automation of web applications.

Native support for web browsers

As indicated earlier Selenium WebDriver drives the browser using the native support of the browser. Firefox browser has in-built support for it. However, for Internet Explorer and Chrome we need to use third-party drivers.

Declaration and usage are as below

  • Firefox
WebDriver driver = new FirefoxDriver();
  • Chrome
WebDriver driver = new ChromeDriver();
 System.setProperty("webdriver.chrome.driver", "path to chrome browser driver");
  • InternetExplorer
WebDriver driver = new InternetExplorerDriver();
 System.setProperty("webdriver.ie.driver", "path to IE browser driver");

Multiple locator strategies

Selenium WebDriver provides multiple locator strategies to find the element on a web page. Some of these are listed below

  • Id
  • Name
  • Xpath
  • CSS
  • Linktext
  • Tagname

Of all the locator types, Id is the most preferred because of its performance, followed by CSS.

Extensive set of simple commands to drive the web

Selenium WebDriver has an extensive set of commands that can be used to perform interaction with the web page. These commands are simple and can be wrapped around a wrapper to make them reusable methods. Some common commands are as follows:

  • findElement – Find the first web element of the page
  • By – Class used with locator to find a web element
  • sendKeys – To pass text content to an input field
  • click – Perform a click action
  • submit – To perform submit action on the page
  • getText – Get the text content from an web element
  • getAttribute – Get attribute values from the web element
  • getCurrentUrl – Get the current page url
  • switchTo() – To Switch to window, frame or an alert
  • navigate() – To navigate to an URL, forward or backward
  • get – To navigate to the web page
  • isEnabled, isDisplayed, and isSelected – Get status of the web element

Select Class to handle dropdowns

WebDriver provides Select class to handle dropdowns in the web page. The web element can be  single-select or multi-select and several methods are available to handle them appropriately. Commonly used commands are as below

selectByIndex
 selectByValue
 selectByVisibleText
 getFirstSelectedOption
 getOptions
 deselectAll

Implicit and Explicit Waits

Automated tests need a way to wait for some time on the web page to perform some action and then move to the next step. Selenium WebDriver provides both Implicit and Explicit Waits for this purpose.

  • Implicit Wait waits for an element to appear on the page until the time provided by the Implicit Wait is exhausted. This wait is common across the project.
  • Explicit Wait is used in situations where we need to wait for some condition to occur, prior to moving further. The simplest example of Explicit Wait is Thread.sleep method and there are other sophisticated waits such as WebDriverWait used along with ExpectedConditions where we can specify the duration in seconds.

Action Classes for advanced interaction

Selenium WebDriver provides Action class to perform  advanced user interactions with the keyboard such as Key up, Key Down along with ALT, CONTROL OR SHIFT, mouse actions such as Double Click, Drag and Drop. There are several other actions available to make automation easier and effective.

Support for Ajax

Selenium WebDriver supports Ajax effectively and can be used to perform actions on the dynamically loaded web elements on a page. It provides various `waitFor’  methods to wait for an element to appear and disappear on the page. These waitFor methods help us to overcome the problem of placing a manual delay and thus reduces chances of script failure if the element has not appeared within the delay provided.

Support for distributed test execution

Selenium WebDriver is available in two forms

  • WebDriver
  • Selenium Server

WebDriver provides the ability to run our tests on our local machine and Selenium server helps to run our tests on remote machines where we can distribute tests over the network on multiple machines.

Get screenshot

We can take a screenshot of the application whenever required using Selenium WebDriver. Screenshots are usually captured on failure conditions  to get the details about a failure scenario.

Taking a screenshot is very simple and it is described below:

File screenshotFileName = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
 FileUtils.copyFile(screenshotFileName, new File("Location where screenshot needs to be saved"));

Conclusion

The main advantage of Selenium WebDriver is that a  single script built can be used by various operating systems and browsers. Thus, to summarize, based on an understanding of Selenium WebDriver’s features, you will agree that web application automation can be done effectively and easily using Selenium WebDriver. To make automation  consistent and reliable we need to build a framework utilizing all the above features along with some tools such as loggers, unit testing frameworks, listeners and reporting utilities.

Read Other Blogs on Selenium:

Getting Started – Selenium with Python Bindings

Introduction to Selenium with C Sharp