Thursday 24 November 2016

Visual / UI Test Automation using Selenium and Applitools Eyes

Visual / UI Testing is a methodology for validating the multiple visual aspects of Websites, Mobile apps and Desktop apps across multiple browser, resolution and OS combinations.

Visual / UI Testing is very important these days as more and more applications are getting web enabled. (i.e more of the standalone applications are being converted into websites) & most of the websites are eyeing on 'Responsive Web Design' to create a single website across multiple resolutions.The mobile apps designed for a platform has to support multiple screen resolutions or devices.

This type of testing is usually performed manually. However, now you can automate these type of tests using different automation tools available in the market. One such automation tool is Applitools Eyes which has the advantage of validating visual aspects within the existing Selenium scripts.

Friday 28 October 2016

JDBC-ODBC Bridge support in Java 8

JDBC-ODBC Bridge offered lot of flexibility in connecting a data source. Many had used this bridge to connect & query MS Excel / MS Access as a database. Starting from Java 8, Oracle has removed this feature. This created a major blocker for many to upgrade to new Java version & many applications which were built based on this have failed.

As an interim solution, one can build an extension from jdbc classes of previous java version & add it to Java 8 extensions.

Follow the below steps to enable the JDBC-ODBC Bridge support in Java 8.

Thursday 27 October 2016

Selenium 3 Impact & Changes

Selenium is out with new stable version - Selenium 3.0.1, and this blog would detail out changes & impact the new version of Selenium brings into automation testing. 

Selenium 3, is believed to have major changes in its implementation & quite a few changes to the existing automation.In Sel-3, the original Selenium Core is being taken off & replaced with the alternative implementation that’s backed by WebDriver. It means, Selenium RC users would run into issues & might need to tweak their scripts to support new implementation. However, for web driver users it is believed to be a simple drop-in upgrade.

Jenkins REST API / Remote API


Jenkins is a open source continuous integration tool written in Java.
It is a server-based system running in a servlet container such as Apache Tomcat. It supports SCM tools including AccuRev, CVS, Subversion, Git, Mercurial, Perforce, Clearcase and RTC, and can execute Apache Ant and Apache Maven based projects as well as arbitrary shell scripts and Windows batch commands.

Jenkins has provided the flexibility of accessing it through code by exposing REST based API.

Tuesday 4 October 2016

Test SOAP Services using REST Assured API

REST Assured(RA) is a framework built on Java, developed to test the REST services. However we can test SOAP services too by forming the request in the below format.

RA has inbuilt support for multiple authentication like BASIC, OAuth, OAuth2, Form, Certificate, Digest, CSRF (Cross Site Request Forgery) etc.

RA out of the box has the support for BDD approach.

Follow the below steps to configure & test the SOAP web services.

Monday 29 August 2016

How to read QR Code or Barcode from Images

Reading Barcodes / QR codes from images seems to be difficult & using the below open source libraries(ZXing - Zebra Crossing) provided by Google will make it simple for any application to include this functionality.

Curious on knowing how Android Apps scan the Barcodes or QR codes from the camera?

The android apps designed to scan 1D & 2D barcodes on a high level convert the data the camera into image bytes to the below library, which in-turn return the data embedded within the bar codes.

Follow the below steps to achieve the same.

Friday 26 August 2016

Test REST Web Services using REST Assured API

REST Assured(RA) is a framework built on Java developed to test the REST services. It supports any HTTP method but has explicit support for GET, POST, PUT, DELETE, HEAD, OPTIONS, PATCH and includes specifying & validating like Headers, Cookies etc.

RA has inbuilt support for multiple authentication like BASIC, OAuth, OAuth2, Form, Certificate, Digest, CSRF (Cross Site Request Forgery) etc.

RA out of the box has the support for BDD approach.

Follow the below steps to configure & test the REST web services.

Tuesday 16 August 2016

Text To Speech Using Voice RSS API

RSS Feeds are well known in the internet world. The new Voice RSS service brings the Speech Synthesis to a new level, where one can get the benefit of this feature with its Cloud Based Solution [SaaS] which requires no installation, no dependency on the technology, fast and accessible at all times.

Voice RSS exposes the Web Service / API to convert the given text into speech. 
Follow the below steps.

Friday 12 August 2016

Convert Text to Audio using FreeTTS

Converting a text to audio may have multiple use cases in automation like creating the audio files for any data feed, voice driven tests etc.

FreeTTS[Free Text To Speech] is a library based on Java Speech API which is built on core technologies like Speech Synthesis and Speech Recognition.

Follow the below steps to configure & code to CONVERT TEXT TO AUDIO

Wednesday 3 August 2016

Handle Windows Authentication Dialog in Automation - Selenium WebDriver

Windows Authentication dialogs are common when we are working in ODC environments.This would cause initial hickup for automation as the authentication pop-ups are out of DOM structure. This can handled in several ways like AutoIT, Sikuli, etc.

Below is one of the simplest way to handle.

Tuesday 2 August 2016

Launch Browser with Extensions - Webdriver


Launching the selenium webdriver, by default opens the plain browser without any extensions.
But there is way, to launch the chrome browser along with the pre-installed extensions.

To load any chrome extension in webdriver, we need to package the extension to .crx file & refer the same file in the desired capabilities / chrome options to load when the browser is launched.

Follow the steps mentioned in the below link to create .crx file.
https://developer.chrome.com/extensions/packaging

Refer the *.crx file path in your code & launch the browser.

Launch Selenium Browser in Emulation Mode or Mobile Mode


Responsive Design Websites are the hot website design in recent days which fits to all device resolutions. Testing the responsiveness of the website on multiple resolutions is very important.

In the absence of real devices or if the application is in development mode, one can launch the selenium browser in mobile/emulation mode by setting the desired capabilities.

Below code snippet would help in launching the browser in emulation mode.
NOTE: This option is very good alternative for Emulators while testing web-app responsiveness.

Sunday 31 July 2016

Capture Screenshot of required element using Selenium


Usually, the selenium tests would capture the complete screenshot of the application. Capturing multiple screens would increase the size of reports or at times it is unnecessary to capture whole screen.

Ever thought of capturing only required web element?
Yes! we can. Follow the below process to capture the required element.

//Find the web element
WebElement elm = driver.findElement(xpath or any locator);
File compFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
BufferedImage image = ImageIO.read(compFile);

//get the image location & save to a file.
Point pnt = elm.getLocation();
BufferedImage elmImg = image.getSubimage(pnt.getX(), pnt.getY(), elm.getSize().getWidth(), elm.getSize().getHeight());
ImageIO.write(elmImg, "png", compFile);

FileUtils.copyFile(compFile, new File("filepath/filename" + ".png"));

Basic 'Broken Link Checker' using Selenium WebDriver


Link Health is very important for any website to reach its customers.
One can make sure if all the links of the website are broken or not, using various available open source or licensed tools.

Below is one of the basic way of validating the links on a particular page using Selenium WebDriver.
NOTE: Can be part of your various regression tests.


Sample Code:


Tuesday 26 July 2016

Test Video using Selenium WebDriver


Testing a video is always a challenging task. Most of the video based web sites are manually tested & are out of scope of automation.

However, the javascript executor in selenium webdriver will enable us to play around with the video components. Thus, few of the test scenarios w.r.t video testing can be automated using the below approach.


Sample Video: Video Component Sample
Video Component: JW Player, JW HTML5 Video Player

Test SVG Graphs Using Selenium WebDriver



At times, during functional testing validating the data in the graphs or charts become crucial to proceed further.On further analysis on dom structure, graph appears to be built on SVG. This complicates the automation testing.

Many a times, testers just leave the particular scenarios as not automatable saying Graphs / images are not automatable. But, that is not right. We'll have one or the other solution to automate everything. Yes! may not be 100 percent.

Sample SVG Graphs: SVG Sample Graphs


Below approach let you know a way to automate SVG graphs using Selenium WebDriver.